@neutrium/quantity - v7.1.0
    Preparing search index...

    Interface QuantityDefinition<T>

    Scalar and counted units produced by a parser or accepted by Quantity. Import from @neutrium/quantity/factory. Empty arrays represent unity. Construction copies and freezes external unit records; duplicate records on each side are coalesced without expanding exponents into repeated tokens. The scalar must already belong to the destination backend. Definitions carry no source adapter; use an existing Quantity for cross-backend construction.

    import { Quantity } from '@neutrium/quantity/number';

    const area = new Quantity({
    scalar: 2,
    numerator: [{ unit: '<meter>', prefix: '<kilo>', exponent: 2 }],
    denominator: []
    });
    area.units(); // "km2"
    interface QuantityDefinition<T = Decimal> {
        denominator: readonly UnitPower[];
        numerator: readonly UnitPower[];
        scalar: T;
    }

    Type Parameters

    • T = Decimal

    Hierarchy

    Index
    denominator: readonly UnitPower[]

    Counted denominator units.

    numerator: readonly UnitPower[]

    Counted numerator units.

    scalar: T

    Numerical value in the specified units.