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.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

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.

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

typescript