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.

typescript

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.

format
TNumberFormatFormat
'decimal'
High-level format dialect: decimal, currency, unit, percent, compact, scientific, engineering.
locale
TNumberFormatLocale
'auto'
BCP-47 locale tag (or array for fallback chains). The literal string "auto" triggers runtime resolution.
currency
string
ISO 4217 currency code. Required when format === "currency".
currencyDisplay
TNumberFormatCurrencyDisplay
'symbol'
Currency-symbol rendering: symbol, narrowSymbol, code, or name.
unit
string
ECMAScript-sanctioned unit identifier. Required when format === "unit".
unitDisplay
TNumberFormatUnitDisplay
'short'
Unit-label rendering: short, long, or narrow.
notation
TNumberFormatNotation
Raw notation override: standard, scientific, engineering, compact.
compactDisplay
TNumberFormatCompactDisplay
'short'
Compact-notation rendering: short or long. Only honoured when notation === "compact".
minimumFractionDigits
number
Minimum digits after the decimal point.
maximumFractionDigits
number
Maximum digits after the decimal point.
minimumSignificantDigits
number
Minimum significant digits (mutually exclusive with fraction digits).
maximumSignificantDigits
number
Maximum significant digits (mutually exclusive with fraction digits).
useGrouping
TNumberFormatUseGrouping
true
Thousands-separator behaviour: true/auto, false, always, min2.
signDisplay
TNumberFormatSignDisplay
'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

typescript