decimalRangeFormatter @localizer/format-number 1.1.1
The decimalRangeFormatter
provides a flexible and customizable way to format numeric ranges. It is particularly useful for scenarios where you need to display a range of numbers with specific formatting options, such as compact notation or localized styles.
Usage
typescript
import { decimalRangeFormatter } from '@localizer/format-number';
const formatter = decimalRangeFormatter({
notation: 'compact',
compactDisplay: 'long',
});
const result = formatter(1000, 2000);
See formatter options for configuration details.
Demo
Locale | Localized value |
---|---|
en-US | 1,000–2,000 |
fr-FR | 1 000–2 000 |
de-DE | 1.000–2.000 |
fi-FI | 1 000–2 000 |
sv-FI | 1 000‒2 000 |
ko-KR | 1,000~2,000 |
hi-IN | 1,000–2,000 |