Skip to content

API reference / @localizer/format-number / relativeDecimalFormatter

Function: relativeDecimalFormatter()

relativeDecimalFormatter<T>(options?): RelativeValueFormatter<T>

Defined in: relativeDecimalFormatter.ts:33

Formats a value relative to a reference as a localized decimal string.

Type Parameters

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

Parameters

ParameterTypeDescription
options?NumberFormatOptionsOptional formatting options for relative decimal values.

Returns

RelativeValueFormatter<T>

A function that formats the difference between a value and a reference using Intl.NumberFormat.