Millwork
    Preparing search index...

    Interface Qty

    The part of a js-quantities Qty that Millwork uses and types. Each method gives a new Qty.

    interface Qty {
        baseScalar: number;
        scalar: number;
        add(other: string | Qty): Qty;
        div(other: string | number | Qty): Qty;
        eq(other: Qty): boolean;
        format(unit?: string): string;
        isBase(): boolean;
        isCompatible(other: string | Qty): boolean;
        mul(other: string | number | Qty): Qty;
        sub(other: string | Qty): Qty;
        to(unit: string | Qty): Qty;
        toBase(): Qty;
        toString(unit?: string | number): string;
        units(): string;
    }
    Index
    baseScalar: number
    scalar: number
    • Adds a compatible quantity.

      Parameters

      • other: string | Qty

      Returns Qty

    • Divides by a quantity or a number.

      Parameters

      • other: string | number | Qty

      Returns Qty

    • Returns true if both quantities are equal after conversion to base units.

      Parameters

      Returns boolean

    • Writes the quantity as text. With a unit, it converts to that unit first.

      Parameters

      • Optionalunit: string

      Returns string

    • Returns true if the unit is a base unit.

      Returns boolean

    • Returns true if the other quantity can convert to this unit.

      Parameters

      • other: string | Qty

      Returns boolean

    • Multiplies by a quantity or a number.

      Parameters

      • other: string | number | Qty

      Returns Qty

    • Subtracts a compatible quantity.

      Parameters

      • other: string | Qty

      Returns Qty

    • Converts to a unit, or to the unit of another quantity.

      Parameters

      • unit: string | Qty

      Returns Qty

    • Writes the quantity as text. A unit or a number of decimals changes the output.

      Parameters

      • Optionalunit: string | number

      Returns string

    • Gives the unit as text, for example m/s.

      Returns string