Documents for @litert/utils-number
    Preparing search index...

    Interface IUnitConverterOptions<T>

    interface IUnitConverterOptions<T extends string | number> {
        baseUnit: T;
        units: IUnit<T>[];
    }

    Type Parameters

    • T extends string | number
    Index

    Properties

    Properties

    baseUnit: T

    The base unit of the converter, which is the reference unit to other units.

    units: IUnit<T>[]

    The other units supported by this converter, excluding the base unit.

    The unit ratios are calculated in order of the array elements, each unit is factor times of the previous unit.

    [ { name: "dm", factor: 10 }, { name: "m", factor: 10 } ]