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

  1. Prepare explicit text tokens, annotated language observations, caller mappings or a supported locale as requested. Preserve source evidence and the stated Unicode counting convention.
  2. Enter decimalIntegerText, localeTag using the field table and calculation rules, then run the tool.
  3. Read localeFormattedInteger, integerGroupWidthsFromRight, observedGroupingSeparators. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. 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 fieldMeaningValue type; see rules belowRequirement
decimalIntegerTextDecimal integer textstringRequired
localeTagLocale tagstringRequired

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 fieldMeaningValue type
localeFormattedIntegerLocale formatted integerstring
integerGroupWidthsFromRightInteger group widths from rightlist of number
observedGroupingSeparatorsObserved grouping separatorslist of string
json
{
  "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

  1. Number Grouping Locale Format Lookup — tool.io

  2. 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.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies