Skip to content

API reference / @localizer/format-number / fixedUnitFormatter

Function: fixedUnitFormatter()

fixedUnitFormatter<T>(unit, options?): ValueFormatter<T>

Defined in: fixedUnitFormatter.ts:34

Creates a formatter for fixed unit values using localization.

Type Parameters

Type ParameterDescription
T extends number | bigintThe value type, either number or bigint.

Parameters

ParameterTypeDescription
unitUnitThe unit for formatting (e.g., 'meter', 'kilogram').
options?NumberFormatOptionsOptional formatting options.

Returns

ValueFormatter<T>

A ValueFormatter for localized fixed unit strings.