API reference
@salmonui/core/format
18 exported symbols: 9 functions, 5 interfaces and 4 types. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/core/format';Functions
createFormatterA formatter for one locale; compiled formats and Intl objects are cached on the instance.createValueFormatterBuilds the value → display string function for a column.describeFormatNormalizes column.format for a column of the given type. Returns null for no format.formatValueFormats a value like a column format would (template helper). Formatters are shared per (locale, currency, time zone).getCollatorLocale-aware comparer used as the default sortComparer for string columns.isRtlLocaleTrue for right-to-left locales (ar, he-IL, fa, ur-PK, az-Arab, ...). Invalid locales are LTR.parseNumberParses localized number text: '1.234,5' in de-DE is 1234.5. Accepts the locale's digits, group, decimal and minus symbols (and ASCII -, and . when it is not th…skeletonToOptionsConverts a CLDR skeleton (yMMMd, Hm, EEEE) into Intl.DateTimeFormat options.toDate
Interfaces
FormatEnvironmentValue formatting backed by the platform Intl API. Formatter instances are created once per (locale, options) pair and cached per engine.FormatOptionsNumber presets (N2, C, P1), custom number patterns (#,##0.00), date skeletons (yMMMd, short), or custom date patterns (dd/MM/yyyy HH:mm).FormatterFormatterOptionsParseNumberOptions
Types
ColumnTypeselection: the row selection checkbox column; rowNumber: the 1-based row number column (no value, rendered from the row position).FormatDescriptorNormalized column.format.LocaleMessageA message: a {param} template, or plural forms chosen by Intl.PluralRules for count (other is required).WarnDevelopment warning sink: (code, message).