.dcss-format-locale

Prints a number with a locale’s digits and separators. Pair it with a locale class.

Example

Result
Markup
<link rel="stylesheet" href="dcss.css">
<link rel="stylesheet" href="families/format.css">

<output class="dcss-format-locale dcss-locale-arabic" data-dcss-locale-prefix="" data-dcss-locale-suffix="" style="--value: -1234.56"></output>

Notes

Set --comma, --sign, --symbol or --trim to 1 to turn that flag on. Inside an element with lang, a format prints in that language and region, from d3-format's locale table: lang="de-DE" prints 1.234,50, and --symbol: 1 adds its currency, € there. A language alone (de) or a region the table doesn't have (de-AT) prints as en-US. The table's locales are ar-AE to ar-YE, ca-ES, cs-CZ, da-DK, de-CH, de-DE, en-GB, en-IE, en-IN, es-BO, es-ES, fi-FI, fr-CA, fr-FR, he-IL, hu-HU, it-IT, ja-JP, ko-KR, mk-MK, nl-NL, pl-PL, pt-BR, pt-PT, ru-RU, sl-SI, sv-SE, uk-UA and zh-CN.

Browser support

BrowserSupport
ChromeYes
SafariYes
FirefoxWhole numbers only

See also