@neutrium/decimal API - v2.2.0
    Preparing search index...

    Class Decimal

    Arbitrary-precision decimal representation, comparison, and formatting. Import the arithmetic or scientific tier when calculations are required.

    Hierarchy (View Summary)

    Index
    • Convert according to JavaScript's primitive hint.

      Parameters

      • hint: "string" | "number" | "default"

      Returns string | number

    • Returns number

      The number of digits after the decimal point, or NaN for a non-finite value.

    • Returns boolean

      Whether this value is a finite even integer.

    • Returns boolean

      Whether this value is a finite odd integer.

    • Returns boolean

      Whether this value is positive or negative zero.

    • Count this value's significant digits.

      Parameters

      • OptionalincludeTrailingIntegerZeros: boolean

      Returns number

    • Returns number

      -1, -0, 0, 1, or NaN according to this value's state.

    • Return the exact string serialized by JSON.

      Returns string

    • Convert to the nearest JavaScript number.

      Returns number

    • Format this value in canonical fixed or exponential notation.

      Returns string

    • Return the exact primitive string value, preserving negative zero.

      Returns string

    • Return the exact string used by default JavaScript coercion.

      Returns string