Properties that can be passed into the constructor for FormatSettings.

interface FormatSettingsProperties {
    currency?: string;
    dateFormat?: string;
    fractionalDigits?: number;
    locale?: string;
    numberFormat?: string;
    timeFormat?: string;
    timeZone?: string;
    useFieldInfo?: boolean;
}

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.

dateFormat?: string

The default format for date values. Either a utilities/format/formats!DateFormat constant, or a custom date format string.

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.

locale?: string

The locale to use when formatting values.

numberFormat?: string

The default format for number values. Either a utilities/format/formats!NumberFormat constant, or a custom number format string.

timeFormat?: string

The default format for time values. Either a utilities/format/formats!DateFormat constant, or a custom time format string.

timeZone?: string

The time zone to display date/time data in. The default will be the user's local time zone.

useFieldInfo?: boolean

Whether to use formatting from the field info if it is specified.