INumberFormatProps

interface
NumberFormat

Props for `<OrigamNumberFormat>` — pure-display i18n number renderer powered by `Intl.NumberFormat` (zero external dep). The component owns NO state: it transforms `value` through the resolved `Intl` instance and emits the result into a `<tag>` element (default `<span>`). Consumers who want to override the rendering granularly use the scoped `#default` slot which exposes `{ formatted, parts, value }`.

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

Héritage

Hérite de

Interfaces parentes dont celle-ci hérite. Leurs propriétés sont disponibles pour tout consommateur de cette interface.

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.

value
requis
number | string
Number to render. Strings are parsed via `Number()` — callers can pass a stringified BigInt-like to preserve precision before coercion (the actual formatting still goes through `Number`, so values beyond `Number.MAX_SAFE_INTEGER` may lose accuracy).
format
TNumberFormatFormat
High-level format dialect — see `TNumberFormatFormat`.
locale
TNumberFormatLocale
BCP-47 locale tag (or array, for fallback chains). The literal string `'auto'` triggers the runtime resolution chain (`<html lang>` → `navigator.language` → `'en-US'`).
currency
string
ISO 4217 currency code. Required when `format === 'currency'`; we fall back to `'USD'` rather than throwing so storybook controls remain forgiving.
currencyDisplay
TNumberFormatCurrencyDisplay
Currency-symbol rendering — `'symbol'` (`$`), `'narrowSymbol'` (`$` instead of `US$`), `'code'` (`USD`) or `'name'` (`US dollar`).
unit
string
Sanctioned unit identifier (e.g. `'kilometer-per-hour'`, `'celsius'`, `'liter'`). Required when `format === 'unit'`. The full ECMAScript-sanctioned list is exposed under `Intl.supportedValuesOf('unit')` at runtime.
unitDisplay
TNumberFormatUnitDisplay
Unit-label rendering — `'short'` (`km/h`), `'long'` (`kilometers per hour`) or `'narrow'` (`kph`).
notation
TNumberFormatNotation
Raw `notation` override. Auto-set to `'compact'` when `format === 'compact'`, to `'scientific'` / `'engineering'` for the matching formats. Explicit values still win — useful for `format: 'decimal'` with `notation: 'scientific'`.
compactDisplay
TNumberFormatCompactDisplay
Compact-notation rendering — `'short'` (`1M`) or `'long'` (`1 million`). 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
Thousands-separator behaviour. `true` / `'auto'` keep the locale default, `false` removes them, `'always'` forces them on, `'min2'` only renders them when the integer part has at least 2 groups.
signDisplay
TNumberFormatSignDisplay
Sign-display strategy. `'auto'` (default — only negatives), `'always'`, `'except-zero'`, `'negative'`, `'never'`.