Format Number
Formats a number with Intl.NumberFormat — decimal, currency or percent, with compact notation and fixed precision.
Examples
html
| 1 | <nana-format-number value="1499.99" type="currency" currency="USD"></nana-format-number> |
| 2 | <nana-format-number value="0.42" type="percent"></nana-format-number> |
| 3 | <nana-format-number value="1500000" notation="compact"></nana-format-number> |
Import
ts
| 1 | import "@nana-tec/ui-components/format-number"; |
Props
| Attribute | Type | Default |
|---|---|---|
value | number | 0 |
type | decimal | currency | percent | decimal |
currency | string | USD |
notation | standard | compact | standard |
locale | string | — |
minimum-fraction-digits | number | — |
maximum-fraction-digits | number | — |