Set Currency Group Separator in number format in CSharp
Description
The following code shows how to set Currency Group Separator in number format.
Example
using System;//from w ww . j av a 2 s . c om
using System.Globalization;
class NumberFormatInfoSample {
public static void Main() {
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
Int64 myInt = 123456789;
Console.WriteLine( myInt.ToString( "C", nfi ) );
nfi.CurrencyGroupSeparator = " ";
Console.WriteLine( myInt.ToString( "C", nfi ) );
}
}
The code above generates the following result.