relativeDecimalFormatter @localizer/format-number 1.1.1
A customizable formatter designed to represent absolute changes between two unitless numeric values.
Usage
typescript
import { relativeDecimalFormatter } from '@localizer/format-number';
const formatter = relativeDecimalFormatter({
notation: 'compact',
compactDisplay: 'long',
});
const result = formatter(3500, 5000);
Represents the change from an initial reference value (first argument) to an updated value (second argument).
See formatter options for configuration details.
Demo
Locale | Localized value |
---|---|
en-US | +1,500 |
fr-FR | +1 500 |
de-DE | +1.500 |
fi-FI | +1 500 |
sv-FI | +1 500 |
ko-KR | +1,500 |
hi-IN | +1,500 |