Set NumberGroupSeparator : NumberFormatInfo « Internationalization I18N « C# / C Sharp






Set NumberGroupSeparator

 
using System.Globalization;
using System;
public class MainClass {
    public static void Main() {

        NumberFormatInfo f = new NumberFormatInfo();
        f.NumberGroupSeparator = " ";
        Console.WriteLine(12345.6789.ToString("N3", f));   // 12 345.679
    }
}
           
         
  








Related examples in the same category

1.Use NumberFormatInfo to format a number
2.NumberFormatInfo.CurrencyDecimalSeparator gets or sets the string to use as the decimal separator in currency values.
3.NumberFormatInfo.CurrencyDecimalDigits indicates the number of decimal places to use in currency values.