Type alias BestConversion<Q, U>

BestConversion<Q, U>: {
    quantity: _LiteralToPrimitive<Q>;
    unit: U;
    toString(toFixed?): `${_LiteralToPrimitive<Q>}${U}`;
}

The return value from converting a unit to 'best'.

Type Parameters

Type declaration

  • quantity: _LiteralToPrimitive<Q>

    The quantity of the unit.

  • unit: U

    The unit.

  • toString:function
    • Join the quantity and the unit together in a string. This method is automatically called when casting this object to a string, meaning you can safely do things like concatenate the object with a string.

      Parameters

      • Optional toFixed: number

        The number of decimal places to include in the string. The result will be padded with zeros if necessary. Providing undefined will use the original number of decimal places. Providing 0 will round the number to the nearest integer. This option is ignored when converting bigints.

      Returns `${_LiteralToPrimitive<Q>}${U}`

Generated using TypeDoc