Thursday, September 4, 2008

how to format the numbers in c#.net?

If you have the number 28 and you want to display it as 28.00 here's how you can format it:

int val = 28;
string formatted = val.ToString("N2");

No comments:

 
Feedback Form