Skip to content

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

─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
LocaleLocalized value
en-US  American English146%
fr-FR  French (France)146 %
de-DE  German (Germany)146 %
fi-FI  Finnish (Finland)146 %
sv-FI  Swedish (Finland)146 %
ko-KR  Korean (South Korea)146%
hi-IN  Hindi (India)146%

See also