formatting numbers

  • Thread starter Thread starter Joo Park
  • Start date Start date
J

Joo Park

I need to format the decimal into following format

3 to 3.00
3.1 to 3.10

How would i do this in C#.

thx in advance!
 
s = i.ToString("N2")

or to right justify this in a field of 10 :

ss = String.Format("{0,10:N2}",i)
 
Back
Top