'How to get the Windows "Digit Grouping" setting

In the Windows Regional control panel is a "Digit Grouping" setting, which indicates whether the Indian numbering system is used, where the thousands separator character groups the first three digits to the left of the decimal together, and thereafter every two digits, vs. the more common grouping where every three digits to the left the decimal are grouped together.

How can I get that setting in VB6?

Or, alternatively, what is the best way to determine when to use that Indian numbering system?



Solution 1:[1]

As Bob77 said in a comment, why not just let FormatNumber do it for you? It will apply the digit grouping from the regional settings. Like this

MsgBox(FormatNumber(123456, , , , vbUseDefault))

"air code" - I have not tried this myself

Solution 2:[2]

'This is how I get my digit grouping. 'Create a label and name it as LabelCheckGrouping 'Then make a calculation: LabelCheckGrouping.Text = 1.23 * 2

'Get the digit grouping with mid function on second digit: DigitGrouping = Mid(LabelCheckGrouping.Text, 2, 1)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MarkJ
Solution 2 Heince Wibowo