Specify thousands separator in CurrentUICulture
I am trying to set the culture information for my Thread
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("d开发者_Go百科e-DE");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
Above is the culture I have set, this works well on number formats for converting decimal information, I am trying to set the thousands separator and I dont know a way without having to set it on the gridview level or using a string.Format.
Does anyone know how to set the thousands separator at the thread culture level ?
This seems to work:
Thread.CurrentThread.CurrentUICulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture;
Thread.CurrentThread.CurrentUICulture.NumberFormat.CurrencyGroupSeparator = "|";
String Test = 123456789.ToString("C");
I'm not sure if I understand your question correctly, but did you try changing it with the property CultureInfo.NumberFormat.NumberGroupSeparator
?
精彩评论