GitHub

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

Currency

$1,234.56 USD 1,234.56 US dollars 1,234.56 ¥1,234 1 234,56 € £1,234.56

Percent

75.00 % 75.6 %

Culture

1.234,560

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.