IUseNumberFormatOptions
interface
Composable Options
Options accepted by useNumberFormat. Mirrors the public props of OrigamNumberFormat minus the wiring concerns (tag, class, style), forwarded directly to Intl.NumberFormat.
TypeScript
Definition
The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.
API
Properties
Every property declared by this interface, with its type, optionality and default.
- formatTNumberFormatFormat'decimal'
- High-level format dialect: decimal, currency, unit, percent, compact, scientific, engineering.
- localeTNumberFormatLocale'auto'
- BCP-47 locale tag (or array for fallback chains). The literal string "auto" triggers runtime resolution.
- currencystring
- ISO 4217 currency code. Required when format === "currency".
- currencyDisplayTNumberFormatCurrencyDisplay'symbol'
- Currency-symbol rendering: symbol, narrowSymbol, code, or name.
- unitstring
- ECMAScript-sanctioned unit identifier. Required when format === "unit".
- unitDisplayTNumberFormatUnitDisplay'short'
- Unit-label rendering: short, long, or narrow.
- notationTNumberFormatNotation
- Raw notation override: standard, scientific, engineering, compact.
- compactDisplayTNumberFormatCompactDisplay'short'
- Compact-notation rendering: short or long. Only honoured when notation === "compact".
- minimumFractionDigitsnumber
- Minimum digits after the decimal point.
- maximumFractionDigitsnumber
- Maximum digits after the decimal point.
- minimumSignificantDigitsnumber
- Minimum significant digits (mutually exclusive with fraction digits).
- maximumSignificantDigitsnumber
- Maximum significant digits (mutually exclusive with fraction digits).
- useGroupingTNumberFormatUseGroupingtrue
- Thousands-separator behaviour: true/auto, false, always, min2.
- signDisplayTNumberFormatSignDisplay'auto'
- Sign-display strategy: auto, always, except-zero, negative, never.
Ecosystem
Used by
Components and composables that extend or consume this interface.
Usage
Examples
Ready-to-paste code snippets using this interface.
Formatting a currency value with useNumberFormat