Skip to content

API reference / @localizer/format-number / relativeCurrencyFormatter

Function: relativeCurrencyFormatter()

relativeCurrencyFormatter<T>(currency, options?): RelativeValueFormatter<T>

Defined in: relativeCurrencyFormatter.ts:34

Formats values relative to a reference as localized currency strings.

Type Parameters

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

Parameters

ParameterTypeDescription
currencyCurrencyCodeThe currency code (e.g., 'USD', 'EUR').
options?NumberFormatOptionsOptional formatting options.

Returns

RelativeValueFormatter<T>

A function to format a value relative to a reference.