.dcss-format-fixed

Prints a number with fixed decimals, and grouping, a sign or a currency if you ask for them.

Example

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

<output class="dcss-format-fixed" style="--value: 10000; --precision: 2; --comma: 1; --sign: 1; --symbol: 1"></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