Using String.Format how can i ensure all numbers have commas after every 3 digits eg 23000 = "23,000" and that 0 returns "0".
String.Format("{0:n}", 0); //gives 0.00 which i dont want. I dont want any decimal places, all numbers will be integers.
You can do this, which I find a bit cleaner to read the intent of:
String.Format("{0:#,###0}", 0);
Example:
string.Format("{0:#,###0}", 123456789); // 123,456,789 string.Format("{0:#,###0}", 0); // 0
1.4m articles
1.4m replys
5 comments
57.0k users