percentFormatter @localizer/format-number 1.1.1
A customizable formatter designed for percentage ratios, allowing precise control over the number of fractional digits displayed.
Usage
typescript
import { percentFormatter } from '@localizer/format-number';
const formatter = percentFormatter({
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
const result = formatter(1.46);
The argument passed to this formatter represents a ratio in its unscaled form, where a value of 1.0
corresponds to 100%
.
See formatter options for configuration details.
Demo
Locale | Localized value |
---|---|
en-US | 146% |
fr-FR | 146 % |
de-DE | 146 % |
fi-FI | 146 % |
sv-FI | 146 % |
ko-KR | 146% |
hi-IN | 146% |