Skip to content

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.

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:

LocaleDisplayConvention
en-US1,234,567.89Comma groups, decimal point
de-DE1.234.567,89Point groups, decimal comma
fr-FR1 234 567,89Narrow nonbreaking spaces, decimal comma
pt-PT1 234 567,89Space groups, decimal comma
de-CH1’234’567.89Apostrophe groups, decimal point
en-IN12,34,567.89Three-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.

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.

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.

Unicode CLDR number rules define grouping, digits, currencies and locale patterns. ECMA-402 NumberFormat defines the Intl options and locale negotiation.