Currency-symbol placement and spacing vary by locale
Aliases: localized currency format · currency symbol placement · currency spacing
What it is
Locale-aware currency formatting turns a numeric value, a currency, and a display locale into an amount string. The currency identifier may precede or follow the number and may be adjacent or separated by a regular, no-break, or narrow no-break space. Placement and spacing belong to locale data, not permanently to the symbol. The same currency can therefore render differently for two audiences.
Why it happens
Unicode LDML places a ¤ placeholder inside locale-specific currency patterns, then combines it with the locale's sign pattern, numbering system, and separators. Alphabetic identifiers can visually run into digits, so CLDR provides an alphaNextToNumber pattern variant; older implementations may use currencySpacing rules to insert a no-break boundary. Concatenating “symbol + number” discards postfixed symbols, controlled whitespace, and bidirectional-text behavior. It also leaves semantic ambiguity unresolved: symbols such as $ and ¥ can name more than one currency.
Where it stops holding
Locale answers how an amount should look; the currency code answers what the amount is. Neither can safely be inferred from the other. A narrow symbol may suit a compact, single-currency list, whereas cross-border quotes, reconciliation, and side-by-side currencies often need an ISO code or qualified symbol. Ordinary spaces can split symbol and number across lines, while NBSP, NNBSP, and bidi controls can behave differently when copied to spreadsheets or exposed to assistive technology. Accounting and standard currency styles may also use different sign patterns.
Applying it
- Store the numeric amount with an ISO currency code and treat locale as a presentation parameter. Use a maintained CLDR/ICU or platform formatter instead of concatenation.
- Exercise each target locale with positive, negative, zero, and large values in narrow containers. Inspect symbol order, actual Unicode spacing, line wrapping, and copied text.
- Show codes such as
USDorCADwherever ambiguity changes a quote, invoice, or settlement decision. If space is constrained, disambiguate at first occurrence and in the accessible name. - Regression-test mixed Latin and Arabic directions, local numbering systems, zoom, screen readers, and spreadsheet paste, and confirm that output comes from the formatter rather than a hard-coded snapshot.
Related
- Same group: S2.03.2 Fraction digits vary by currency · S2.03.3 Currency conversions need a rate timestamp and source · S2.03.4 Tax-inclusive and tax-exclusive display practices differ
- Adjacent: S2.02 Numbers, decimals, and digit grouping · S1.02 Mirroring for right-to-left languages
- Search terms:
locale-aware currency formatting·currency pattern·currency spacing