下面的代码适用于小数分隔符,这意味着,对于 pt-pt 它呈现“,”,而 en-us 它呈现“。”
如何使用千位分隔符完成相同的行为?
decimal dec = Convert.ToDecimal(20000.01);
IFormatProvider portuguese = new System.Globalization.CultureInfo("pt-pt");
IFormatProvider english = new System.Globalization.CultureInfo("en-us");
Console.WriteLine(dec.ToString(portuguese));
Console.WriteLine(dec.ToString(english));