Skip to content

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

LocaleLocalized value
en-US  American English10% – 20%
fr-FR  French (France)10–20 %
de-DE  German (Germany)10–20 %
fi-FI  Finnish (Finland)10–20 %
sv-FI  Swedish (Finland)10‒20 %
ko-KR  Korean (South Korea)10% ~ 20%
hi-IN  Hindi (India)10% – 20%

See also