Skip to content

API reference / @localizer/format-number / fixedUnitRangeFormatter

Function: fixedUnitRangeFormatter() ​

fixedUnitRangeFormatter<T>(unit, options?): ValueRangeFormatter<T>

Defined in: fixedUnitRangeFormatter.ts:34

Creates a formatter for fixed unit ranges using localization.

Type Parameters ​

Type ParameterDescription
T extends number | bigintThe type of values to format, either number or bigint.

Parameters ​

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

Returns ​

ValueRangeFormatter<T>

A ValueRangeFormatter that formats a range of values with a fixed unit.