Skip to content

relativeCurrencyFormatter
@localizer/format-number 1.1.1

A customizable formatter designed to represent absolute monetary changes using a specified currency. It simplifies the comparison between an initial and updated value, making it easier to interpret financial differences.

Usage

typescript
import { 
relativeCurrencyFormatter
} from '@localizer/format-number';
const
formatter
=
relativeCurrencyFormatter
('EUR', {
notation
: 'compact',
compactDisplay
: 'long',
}); const
result
=
formatter
(3500, 5000);

Represents the change from an initial reference value (first argument) to an updated value (second argument).

See formatter options for configuration details.

Demo

compact
long
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
EUR - Euro
LocaleLocalized value
en-US  American English+€1,500.00
fr-FR  French (France)+1 500,00 €
de-DE  German (Germany)+1.500,00 €
fi-FI  Finnish (Finland)+1 500,00 €
sv-FI  Swedish (Finland)+1 500,00 €
ko-KR  Korean (South Korea)+€1,500.00
hi-IN  Hindi (India)+€1,500.00

See also