Countries and locales
A country, a language, a currency, and a numbering system describe different things. Select a locale for the reader and an explicit currency for the amount. Formatting does not perform currency or measurement conversion.
Choose a locale per column
Section titled “Choose a locale per column”Using the Pro setup, change only locale:
grid.columns = [{ prop: 'amount', name: 'Amount', dataGridFormat: { value: { kind: 'preset', preset: 'number', locale: 'de-DE', decimalPlaces: 2, } },}];Typical Intl displays for the same raw number 1234567.89:
| Locale | Display | Convention |
|---|---|---|
en-US | 1,234,567.89 | Comma groups, decimal point |
de-DE | 1.234.567,89 | Point groups, decimal comma |
fr-FR | 1 234 567,89 | Narrow nonbreaking spaces, decimal comma |
pt-PT | 1 234 567,89 | Space groups, decimal comma |
de-CH | 1’234’567.89 | Apostrophe groups, decimal point |
en-IN | 12,34,567.89 | Three-digit final group, then two-digit groups |
ar-EG | ١٬٢٣٤٬٥٦٧٫٨٩ | Arabic digits and separators |
These are examples, not a parser grammar. Actual spacing, direction marks, digits, currency symbols and compact abbreviations depend on the runtime’s locale data. Do not compare localized output with ASCII-only snapshots. Use explicit locales for consistent server and browser intent.
Choose the numbering system
Section titled “Choose the numbering system”BCP 47 Unicode extensions work with preset locales, for example ar-EG-u-nu-latn for Latin digits. For all Intl options, use a Core template:
const number = new Intl.NumberFormat('ar-EG', { numberingSystem: 'arab', maximumFractionDigits: 2,});grid.columns = [{ prop: 'amount', name: 'Amount', cellTemplate: (_h, { value }) => value == null ? '' : number.format(value),}];Create formatters once, outside the cell callback. A template formats display only; configure editing separately. In right-to-left applications, test mixed currency symbols, punctuation and digits in the actual page direction.
Define input independently
Section titled “Define input independently”1,234 could mean one thousand two hundred thirty-four or a decimal quantity. Intl.NumberFormat formats values and supplies formatToParts; it does not expose a general localized-input parser. Do not remove all punctuation or use parseFloat as a universal parser.
Choose one input contract: canonical dot-decimal input; an explicitly configured locale parser; or separate currency/unit controls. Apply it to editing, paste, imports and server validation. Preserve missing values, signs, exponents and nonbreaking spaces deliberately. The Pro display locale does not select a localized editor parser, and Numeral locale state is independent from Intl.
References
Section titled “References”Unicode CLDR number rules define grouping, digits, currencies and locale patterns. ECMA-402 NumberFormat defines the Intl options and locale negotiation.