Format Number
Locale-aware number formatting for decimal, currency, and percent.
<rhx-format-number>
Examples
Decimal
1,234.56
1234.56
1.5
1.00
<rhx-format-number rhx-value="1234.56" />
<rhx-format-number rhx-value="1234.56" rhx-no-grouping="true" />
<rhx-format-number rhx-value="1.5" rhx-minimum-fraction-digits="0"
rhx-maximum-fraction-digits="3" />
<rhx-format-number rhx-value="1.0" rhx-minimum-fraction-digits="2"
rhx-maximum-fraction-digits="2" />
Currency
$1,234.56
USD 1,234.56
US dollars 1,234.56
¥1,234
1 234,56 €
£1,234.56
<rhx-format-number rhx-value="1234.56" rhx-type="currency" rhx-currency="USD" />
<rhx-format-number rhx-value="1234.56" rhx-type="currency" rhx-currency="USD"
rhx-currency-display="code" />
<rhx-format-number rhx-value="1234.56" rhx-type="currency" rhx-currency="USD"
rhx-currency-display="name" />
<rhx-format-number rhx-value="1234" rhx-type="currency" rhx-currency="JPY" />
<rhx-format-number rhx-value="1234.56" rhx-type="currency" rhx-currency="EUR" />
<rhx-format-number rhx-value="1234.56" rhx-type="currency" rhx-currency="GBP" />
Percent
75.00 %
75.6 %
<rhx-format-number rhx-value="0.75" rhx-type="percent" />
<rhx-format-number rhx-value="0.756" rhx-type="percent"
rhx-maximum-fraction-digits="1" />
Culture
1.234,560
<rhx-format-number rhx-value="1234.56" rhx-lang="de-DE" />
Properties
| Property | Type | Default | Description |
|---|---|---|---|
rhx-value |
double |
0 |
The number to format |
rhx-type |
string |
decimal |
Format type: decimal, currency, percent |
rhx-currency |
string |
- |
ISO currency code (e.g. USD, EUR) |
rhx-currency-display |
string |
symbol |
Currency display: symbol, code, name |
rhx-lang |
string |
- |
Culture/locale (e.g. de-DE) |
rhx-no-grouping |
bool |
false |
Disable thousands grouping |
rhx-minimum-fraction-digits |
int? |
- |
Minimum decimal places |
rhx-maximum-fraction-digits |
int? |
- |
Maximum decimal places |
Accessibility
- Renders as inline text content — screen readers read the formatted value naturally.
- No interactive elements or ARIA attributes required.