Locale-sensitive number grouping

Raymond Chen

Most westerners are familiar with the fact that the way numbers are formatted differ between the United States and much of Europe.

United States1,234,567.89
France1 234 567,89

What people don’t realize is that the grouping is not always in threes. In India, the least significant group consists of three digits, but subsequent groups are in pairs.


I’ve also seen reports that the first group consists of five digits, followed by pairs:


Meanwhile, Chinese and Japanese traditionally group in fours.

China, Japan123 4567.89

What does this mean for you? Don’t assume that numbers group in threes, and of course you can’t assume that the grouping separator is the comma and the decimal character is the period. Just use the GetNumberFormat function and let NLS do the work for you.

Next time, a little more about that NUMBERFMT structure.