Skip to content

decimalFormatter
@localizer/format-number 1.1.1

The decimalFormatter is a versatile and customizable utility designed for formatting numeric values. It supports various configurations, allowing you to tailor the output to meet specific requirements, such as compact notation or localized display formats.

Usage

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

See formatter options for configuration details.

Demo

compact
long
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
LocaleLocalized value
en-US  American English1,234,567.89
fr-FR  French (France)1 234 567,89
de-DE  German (Germany)1.234.567,89
fi-FI  Finnish (Finland)1 234 567,89
sv-FI  Swedish (Finland)1 234 567,89
ko-KR  Korean (South Korea)1,234,567.89
hi-IN  Hindi (India)12,34,567.89

See also