I want to add comma to decimal numbers every 3 digits using c#.
I wrote this code :
double a = 0; a = 1.5; Interaction.MsgBox(string.Format("{0:#,###0}", a));
But it returns 2.
Where am I wrong ?
Please describe how can I fix it ?
Sommaire |
I want to add comma to decimal numbers every 3 digits using c#.
I wrote this code :
double a = 0; a = 1.5; Interaction.MsgBox(string.Format("{0:#,###0}", a));
But it returns 2.
Where am I wrong ?
Please describe how can I fix it ?
double a = 1.5; Interaction.MsgBox(string.Format("{0:#,###0.#}", a));
License : cc by-sa 3.0
http://stackoverflow.com/questions/6161254/add-comma-to-numbers-every-three-digits-using-c-sharp