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
Définition
La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.
API
Propriétés
Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.
- 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.
Écosystème
Utilisé par
Composants et composables qui étendent ou consomment cette interface.
Usage
Exemples
Extraits de code prêts à coller utilisant cette interface.
Formatting a currency value with useNumberFormat