The following approach should give you what you are looking for:
double d = 123456789.1; string format = d.ToString().IndexOf(NumberFormatInfo.CurrentInfo.NumberDecimalSeparator) >=0 ? "#,##0.00" : "#,##0"; Console.WriteLine (d.ToString(format));
This will also work for cultures that do not have three-digit groups.
Fredrik MΓΆrk
source share