• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

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?
0
JMandler
Asked:
JMandler
1 Solution
 
jkrCommented:
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now