API reference / @localizer/format / autoFormat
Function: autoFormat()
autoFormat(
value):Localizable
Defined in: fn/autoFormat.ts:124
Formats a value into a Localizable object based on its type. By default, it uses the following formatters:
- Numbers and bigints: formatted with
decimal. Numberobjects: formatted using their primitive value.Dateobjects: formatted withdate.- Arrays: recursively formatted into a localized list.
Localizablevalues: returned as-is.undefined: represented asEmpty.- Others: converted to a localized string with
stringify.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to format. |
Returns
A Localizable object.