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); //give
I up-marked another answer and then found that zero values are an empty string.
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("de-DE");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
double x = 23232323.21;
string y = x.ToString("#,0", System.Globalization.CultureInfo.CurrentCulture);
The string is returned in the current culture which is German therefore y = 23.232.323
y = 0 when x = 0.