Unit @localizer/format-number 1.0.1
unitFormatter<
T
> (options?
): UnitValueFormatter<T
, Unit>
T
extends number | bigint - The type of value to format.options
- Optional configuration of the formatter.
Use this formatter to represent measurements in different units.
TIP
If you prefer to use default settings, consider using a preconfigured unit formatter. It simplifies the process by providing a ready-to-use configuration for common use cases.
TIP
If the unit is predetermined, you might find the fixed unit formatter more suitable. It is optimized for scenarios where the unit does not change, offering improved performance and simplicity.