How to parse locale specific number strings

I have an application that needs to run in 20 different locales. One part of the app contains a dialog with a control where a number is entered. The number format can be n.n or n,n dependding on the locale.

How do I check the number string to insure it conforms to the locale, and how do I then convert it to a number?
JMandlerAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
Call 'GetLocaleInfo()' and query for 'LOCALE_SDECIMAL' to get the decimal separator. See also http://www.codeproject.com/KB/edit/Numeric_edit_box.aspx ("Localized numeric editbox") for a complete example, you probably will be able to re-use a lot of that code.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.