Decimal (Default)
The default type is decimal. Numbers are formatted with
locale-aware grouping by default.
1000:
1234567.89:
No grouping:
Percentages
Set type="percent" to format a value as a percentage (0–1 maps to 0%–100%).
0:
0.25:
0.5:
0.75:
1:
Currency
Set type="currency" and currency to an ISO 4217 code. Use
currency-display to control the symbol style.
USD (symbol):
GBP (symbol):
EUR (symbol):
USD (name):
USD (code):
Fraction Digits
Control decimal precision with minimum-fraction-digits and
maximum-fraction-digits.
min 2 fraction digits:
min 3 fraction digits:
max 2 fraction digits:
max 0 fraction digits:
Significant Digits
Use minimum-significant-digits and
maximum-significant-digits for significant-figure precision.
min 4 sig digits:
max 4 sig digits:
max 2 sig digits:
Integer Digit Padding
Use minimum-integer-digits to pad the integer part with leading zeros.
5 with min 4 int digits:
42 with min 6 int digits: