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
Locale | Localized value |
---|---|
en-US | 1,234,567.89 |
fr-FR | 1 234 567,89 |
de-DE | 1.234.567,89 |
fi-FI | 1 234 567,89 |
sv-FI | 1 234 567,89 |
ko-KR | 1,234,567.89 |
hi-IN | 12,34,567.89 |