Kirit Chandran
Kirit Chandran

Reputation: 719

Specify thousands separator in CurrentUICulture

I am trying to set the culture information for my Thread

Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("de-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 ?

Upvotes: 2

Views: 6668

Answers (2)

Steve Wellens
Steve Wellens

Reputation: 20620

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");

Upvotes: 2

grysik44
grysik44

Reputation: 233

I'm not sure if I understand your question correctly, but did you try changing it with the property CultureInfo.NumberFormat.NumberGroupSeparator?

Upvotes: 1

Related Questions