Millwork
    Preparing search index...

    Class Decimal

    An exact decimal number. It keeps the digits and the scale of the wire string, so "123.4500" writes back as "123.4500". A Decimal is immutable. equals ignores trailing zeros. It does no arithmetic: use @millwork-ts/decimal for math.

    Index
    coefficient: bigint

    The integer digits: the value is coefficient / 10 ** scale.

    scale: number

    The number of digits after the point.

    • Writes the decimal with scale digits after the point. It throws a RangeError if digits are lost.

      Parameters

      • scale: number

      Returns string