Click here to Skip to main content
15,911,139 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi!

i'm having the values in the db like this

1234.56
234.56
1237.45
23.00
2.00


when i'm displaying these values in the design page ..it displays like

1234.56
234.56
1237.45
23.00
2.00


but i want to display values in below order

1234.56
 234.56
1237.45
  23.00
   2.00


can any one help me how can i do this thing?
Posted
Updated 22-Dec-11 0:25am
v2
Comments
R. Giskard Reventlov 22-Dec-11 6:29am    
Do yuou mean to format them as right-aligned, not ordered?
surikarthi 22-Dec-11 6:57am    
i tried as the right align
but i need to display values in the correct order with decimal according to the result i'm expecting is der in above..
Richard MacCutchan 22-Dec-11 7:19am    
Maybe if you show the code you are using to display these values then people can offer some better suggestions.
surikarthi 22-Dec-11 7:38am    
ya sure
surikarthi 22-Dec-11 7:41am    
private void FnGetvitalstatics(int contractorID)
{
try
{

if (contractorID != '0')
{
Prepopulatevitalstatics = viewdash.GetvitalstatformDB(contractorID);

if (Prepopulatevitalstatics.Rows.Count > 0)
{
DataTable dt = new DataTable();
dt = Prepopulatevitalstatics;
if (dt != null)
{

if (dt.Rows[0][1].ToString() != null)
{
Decimal netpay = Convert.ToDecimal(dt.Rows[0][1]);
lblnetpay.Text = Convert.ToString(String.Format("{0:N}", netpay));
}
else
{
lblnetpay.Visible = false;
}

if (dt.Rows[0][2].ToString() != null)
{
Decimal leasebaAmt = Convert.ToDecimal(dt.Rows[0][2]);
lblleaseba.Text= String.Format("{0:0,0.00}", leasebaAmt);


}
else
{

lblleaseba.Visible=false;
}


if (dt.Rows[0][4].ToString() != null)
{
Decimal taxpaidAmt = Convert.ToDecimal(dt.Rows[0][4]);
lbltaxpaid.Text= String.Format("{0:0,0.0}", taxpaidAmt);

}
else
{
lbltaxpaid.Visible = false;
}




}
else
{
pnlvital.Visible = false;
lblvital.Text = "No vitalstatics have been processed to display";

}

}

}
catch (Exception)
{

throw;
}
}

1 solution

isn't it a css issue?? setting float right on the display may work for u..
 
Share this answer
 
Comments
surikarthi 22-Dec-11 7:00am    
its not working
i need to display value in this manner
123.00
13456.00
20.00

but it displaying like

123.00
13456.00
20.00
surikarthi 22-Dec-11 7:01am    
i need to display all the decimal values in same way as this
1234.00
15.00
345.00

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900