Skip to content

fixedCurrencyFormatter
@localizer/format-number 1.1.1

The fixedCurrencyFormatter is a versatile utility designed to format monetary values consistently using a predefined currency. It allows customization of display options, such as currency symbols, compact notation, and more, ensuring clarity and adaptability for various use cases.

Usage

typescript
import { 
fixedCurrencyFormatter
} from '@localizer/format-number';
const
formatter
=
fixedCurrencyFormatter
('EUR', {
currencyDisplay
: 'symbol',
notation
: 'compact',
compactDisplay
: 'short',
}); const
result
=
formatter
(21436587);

See formatter options for configuration details.

Demo

compact
short
─── unset ───
─── unset ───
─── unset ───
symbol
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
EUR - Euro
LocaleLocalized value
en-US  American English€21,436,587.00
fr-FR  French (France)21 436 587,00 €
de-DE  German (Germany)21.436.587,00 €
fi-FI  Finnish (Finland)21 436 587,00 €
sv-FI  Swedish (Finland)21 436 587,00 €
ko-KR  Korean (South Korea)€21,436,587.00
hi-IN  Hindi (India)€2,14,36,587.00

See also