我正在使用具有多种文化的应用程序,当我将文化'pt'更改为'en'时,小数分隔符将更改为。有办法修复小数分隔符?
感谢。
答案 0 :(得分:5)
通过修改标准的CultureInfo
滚动自己的var cInfo = CultureInfo.CreateSpecificCulture("en-us");
cInfo.NumberFormat.NumberDecimalSeparator = ",";
cInfo.NumberFormat.CurrencyGroupSeparator = ",";
cInfo.NumberFormat.PercentDecimalSeparator = ",";
Thread.CurrentThread.CurrentCulture = cInfo;
Thread.CurrentThread.CurrentUICulture = cInfo;
:
{{1}}