Default settings that affect how numbers are formatted and parsed.

interface NumberSettings {
    currency?: string;
    defaultFormat?: string;
    defaultParseFormat?: string | string[];
    fractionalDigits?: number;
}

Hierarchy (view full)

Implemented by

Properties

currency?: string

The 3-letter ISO 4217 currency code (e.g "USD", "CAD"). Required when formatting a number using NumberFormat.CURRENCY or NumberFormat.ACCOUNTING.

defaultFormat?: string

The default format for formatting numbers. See utilities/format/number!NumberFormatter.format.

defaultParseFormat?: string | string[]

Either a single format, or one of several possible formats that the input is expected to be in. If specified, the input must exactly match. The syntax is the same as for utilities/format/number!NumberFormatter.format.

fractionalDigits?: number

The number of digits to show after the decimal point. If unspecified, an appropriate value is determined based on the locale and currency.