View as Markdown

API reference: @salmonui/core/format

FormatOptionsinterface

import type { FormatOptions } from '@salmonui/core/format';
interface FormatOptions {
    readonly type?: 'number' | 'date' | 'datetime';
    readonly format?: string;
    readonly skeleton?: string;
    readonly currency?: string;
    readonly minimumFractionDigits?: number;
    readonly maximumFractionDigits?: number;
    readonly useGrouping?: boolean;
    readonly timeZone?: string;
}

Number presets (N2, C, P1), custom number patterns (#,##0.00), date skeletons (yMMMd, short), or custom date patterns (dd/MM/yyyy HH:mm).

FormatOptions members (8)
NameSignatureDescription
typeoptionalreadonly type?: 'number' | 'date' | 'datetime';
formatoptionalreadonly format?: string;

Preset or custom pattern.

skeletonoptionalreadonly skeleton?: string;

Date skeleton such as yMd, yMMMEd, Hm, or a style: short | medium | long | full.

currencyoptionalreadonly currency?: string;

ISO 4217 code for currency formats. Defaults to the grid currency option.

minimumFractionDigitsoptionalreadonly minimumFractionDigits?: number;
maximumFractionDigitsoptionalreadonly maximumFractionDigits?: number;
useGroupingoptionalreadonly useGrouping?: boolean;
timeZoneoptionalreadonly timeZone?: string;

IANA time zone. Defaults to the grid timeZone option. Set it for deterministic SSR output.