Skip to content

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

compact
─── unset ───
─── unset ───
─── unset ───
─── unset ───
narrow
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
─── unset ───
byte
Please Select
LocaleLocalized value
en-US  American English1,440,000 byte
fr-FR  French (France)1 440 000 o
de-DE  German (Germany)1.440.000 Byte
fi-FI  Finnish (Finland)1 440 000 t
sv-FI  Swedish (Finland)1 440 000 B
ko-KR  Korean (South Korea)1,440,000byte
hi-IN  Hindi (India)14,40,000 बाइट

See also