Example
Props
Format
The default style "decimal"
, is for plain number formatting. Values of "percent"
will be multiplied by 100
before formatting.
Values of "currency"
and "unit"
are valid, but can be omitted. The format for each will be derived from the currency and unit props, respectively.
Currency
The currency
to use when formatting the value. Possible values are the ISO 4217 currency codes, such as “USD” for the US dollar, “EUR” for the euro, or "CNY" for the Chinese RMB — see the Current currency & funds code list.
When a currency
is provided the format property will be derived automatically.
Units
A limited set of unit identifiers is available. Pairs of simple units can be concatenated with "-per-" to make a compound unit.
When a unit
is provided the format property will be derived automatically.
Abbreviations
For interfaces with limited real estate you may want to abbreviate
some numeric values.
Be cautious when abbreviating unit values. It may yield unexpected results.
Precision
Override the default precision
behaviour. Provide a tuple to allow minimum and maximum fraction digits.
Avoid setting precision when formatting currency values. Prefer the ISO standard in most cases.
Patterns
Composition
Compose Numeral
with other components to create rich interfaces.