Number Grouping Locale Format Lookup
Resolve actual runtime Intl integer grouping pattern for supported caller locale using exact decimal-text BigInt, retaining non-Western group sizes/native digits; host ICU/CLDR conventions are runtime-dependent, not fixed language-wide rules.
Description
Integer grouping varies by locale and runtime locale data.
Integer grouping varies by locale and runtime locale data. Exact decimal text avoids loss of large integers before formatting.1, 2
Enter signed ASCII integer text of at most1000 characters and a valid supported locale tag at most128. Canonicalize locale, format with grouping and return display, right-to-left group widths and distinct separators.
When to use Number Grouping Locale Format Lookup
Use Number Grouping Locale Format Lookup when you need to evaluate the supplied records under the calculation and evidence rules below. Host ICU/CLDR determines output and native digits. No decimal fractions, parsing or fixed language-wide grouping rule is supplied.
Prepare explicit text tokens, annotated language observations, caller mappings or a supported locale as requested. Preserve source evidence and the stated Unicode counting convention.
How to use Number Grouping Locale Format Lookup and understand its results
- Prepare explicit text tokens, annotated language observations, caller mappings or a supported locale as requested. Preserve source evidence and the stated Unicode counting convention.
- Enter decimalIntegerText, localeTag using the field table and calculation rules, then run the tool.
- Read localeFormattedInteger, integerGroupWidthsFromRight, observedGroupingSeparators. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| decimalIntegerText | Decimal integer text | string | Required |
| localeTag | Locale tag | string | Required |
Enter signed ASCII integer text of at most1000 characters and a valid supported locale tag at most128. Canonicalize locale, format with grouping and return display, right-to-left group widths and distinct separators.
format BigInt with Intl.NumberFormat; read integer-part widths from right Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| localeFormattedInteger | Locale formatted integer | string |
| integerGroupWidthsFromRight | Integer group widths from right | list of number |
| observedGroupingSeparators | Observed grouping separators | list of string |
{
"input": {
"decimalIntegerText": "123456789",
"localeTag": "hi-IN"
},
"output": {
"localeFormattedInteger": "12,34,56,789",
"integerGroupWidthsFromRight": [
3,
2,
2,
2
],
"observedGroupingSeparators": [
","
]
}
} Limitations and assumptions
Host ICU/CLDR determines output and native digits. No decimal fractions, parsing or fixed language-wide grouping rule is supplied.
Numeric inputs, where present, must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use Decimal Comma vs Point Region Lookup: A locale’s decimal separator need not be a comma or point. Runtime internationalization data determines the observed formatting. For a complementary task, use Date Format Locale Order Lookup: Numeric date order can be inspected independently of the current clock. Fixing Gregorian calendar, UTC and Latin digits makes the probe unambiguous.
Further background: ECMAScript Internationalization API.
References
-
Number Grouping Locale Format Lookup — tool.io
-
ECMAScript Internationalization API — Ecma International
Similar or alternative tools
- Decimal Comma vs Point Region Lookup
A locale’s decimal separator need not be a comma or point. Runtime internationalization data determines the observed formatting.
- Date Format Locale Order Lookup
Numeric date order can be inspected independently of the current clock. Fixing Gregorian calendar, UTC and Latin digits makes the probe unambiguous.