percentRange @localizer/format 1.1.1
The percentRange
formats a range of percentage ratios, converting unscaled numeric values into a human-readable percentage range. For example, given the inputs 0.1
and 0.2
, the output would represent the range 10% - 20%
.
Usage
typescript
import { percentRange } from '@localizer/format';
const result = percentRange(0.1, 0.2);
The arguments passed to this formatter represent a ratio in its unscaled form, where a value of 1.0
corresponds to 100%
.
Demo
Locale | Localized value |
---|---|
en-US | 10% – 20% |
fr-FR | 10–20 % |
de-DE | 10–20 % |
fi-FI | 10–20 % |
sv-FI | 10‒20 % |
ko-KR | 10% ~ 20% |
hi-IN | 10% – 20% |