fixedUnitFormatter @localizer/format-number 1.1.1
The fixedUnitFormatter
is a versatile utility designed to format measurement values with a predefined unit. It allows you to customize the output using various configuration options, such as unit display style, significant digits, and notation format. This makes it ideal for presenting numerical data in a clear and concise manner, tailored to your specific requirements.
Usage
typescript
import { fixedUnitFormatter } from '@localizer/format-number';
const formatter = fixedUnitFormatter('byte', {
unitDisplay: 'narrow',
maximumSignificantDigits: 2,
notation: 'compact',
});
const result = formatter(1440000);
See formatter options for configuration details.
Demo
Locale | Localized value |
---|---|
en-US | 1,440,000 byte |
fr-FR | 1 440 000 o |
de-DE | 1.440.000 Byte |
fi-FI | 1 440 000 t |
sv-FI | 1 440 000 B |
ko-KR | 1,440,000byte |
hi-IN | 14,40,000 बाइट |