Skip to main content

Interface: UnitFormatOptions

Defined in: unit.ts:34

Properties​

base?​

optional base?: SIPrefix;

Defined in: unit.ts:43

The prefix the stored value is already in.

A control that keeps milliseconds in value is { base: 'm' } with a unit of 's': 1500 then displays as 1.5s, and parse gives 1500 back.

Default​

''

digits?​

optional digits?: number;

Defined in: unit.ts:57

Digits after the decimal point. The number is left as-is when omitted.


prefixes?​

optional prefixes?: boolean;

Defined in: unit.ts:53

Whether to scale the number and pick a prefix at all.

Turn it off for anything that is not an SI quantity. dB, %, cents and semitones do not take prefixes, and -6dB read as "-6 deci-B" is wrong rather than merely unusual.

Default​

true

separator?​

optional separator?: string;

Defined in: unit.ts:62

Text placed between the number and the unit.

Default​

''