By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

How do I read user's regional settings ?

P: n/a
I want to know the decimal separator and the group separator character
that the user has set in Regional Settings in Control Panel.

I tryied to use System.Globalization.NumberFormatInfo.CurrentInfo like
that:

NumberFormatInfo numInfo =
System.Globalization.NumberFormatInfo.CurrentInfo;
string ds = numInfo.CurrencyDecimalSeparator;
string gs = numInfo.CurrencyGroupSeparator;

These properties do not contain the values that the user has selected
from the "Regional Settings" but the proper values for the current
language.

This means that if the user has selected: "English (United Kindom)"
from the "Regional Settings" and then has changed the values of
separators using the "Customize" button, the above code will return
the proper separators for "English (United Kindom)" and not the custom
ones.

How can I read the separators that the user has selected from regional
settings ?
Thanks

Emmanuel
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
>How can I read the separators that the user has selected from regional
settings ?


Have a look at the CurrentCulture property - it should give you access
to all the settings you're interested in. It will be initialized to
whatever the user has defined in his regional settings (as far as I
can tell).

Marc

================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Nov 15 '05 #2

P: n/a
Thank you Marc, but unfortunatelly it doesn't. It returns the default
settings for the current culture and not the user customized settings.

Any other ideas ?

Emmanuel

"Marc Scheuner [MVP ADSI]" <m.********@inova.SPAMBEGONE.ch> wrote in message
news:to********************************@4ax.com...
How can I read the separators that the user has selected from regional
settings ?


Have a look at the CurrentCulture property - it should give you access
to all the settings you're interested in. It will be initialized to
whatever the user has defined in his regional settings (as far as I
can tell).

Marc

================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch

Nov 15 '05 #3

P: n/a
>Thank you Marc, but unfortunatelly it doesn't. It returns the default
settings for the current culture and not the user customized settings.

Any other ideas ?


There's also a CurrentUICulture - not sure if that might work.

Marc
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.