Digit groups are not always three digits
Aliases: digit grouping size · Indian digit grouping · primary secondary grouping
What it is
Locale-specific digit grouping sizes recognize that integer digits are not always divided into repeated groups of three from the right. Some locale number patterns use a rightmost group of three followed by repeating groups of two. minimumGroupingDigits can also suppress the first separator while integer length is below the primary grouping size plus that threshold. “Thousands separator” is therefore an informal name for only some patterns, not a global data model.
Why it happens
A locale number pattern can define a primary grouping size nearest the decimal and a secondary size repeated to its left. The same magnitude might be grouped as 12,345,678 in one pattern and 1,23,45,678 in another. A numbering system primarily determines digit characters, not these group sizes. Grouping helps readers recognize magnitude, while mechanically inserting a separator every three digits disrupts locally familiar lakh- and crore-scale chunks.
Where it stops holding
Account, identity, telephone, and product numbers contain digits but are usually identifiers rather than quantities and should not receive generic numeric grouping. Years and short integers may also remain ungrouped under locale rules. Grouping is a readable representation and does not change value; storage and calculation must not infer magnitude from a count of commas.
Applying it
- Use a locale number formatter so primary and secondary sizes plus the
minimumGroupingDigitsthreshold come from locale data rather than inserting a character every three digits. - Distinguish quantities from digit-based identifiers in the field model; apply numeric grouping only to the former and domain-specific number rules to the latter.
- Test one digit below, at, and above the target locale's first-grouping threshold, then cover primary/secondary boundaries, negatives, fractions, compact notation, and non-Latin digits.
- Align numeric tables by value and decimal position; do not remove local grouping merely to force equal string widths across regions.
Related
- Same group: S2.02.1 Decimal and grouping separators swap across regions · S2.02.3 Negative-number notation varies · S2.02.4 Numeric input must accept local formats
- Adjacent: S2.03 Currency and prices · S2.04 Measurement systems
- Search terms:
primary grouping size·secondary grouping size·Indian numbering system