A type for arbitrary precision, non-negative decimals.

Instances of this class are immutable.

Hierarchy

  • Decimal

Accessors

  • get fractionalDigits(): number
  • Returns number

Methods

  • Returns the greatest decimal <= this which has no fractional part (rounding down)

    Returns Decimal

  • a.minus(b) returns a-b.

    Both values need to have the same fractional digits. The resulting difference needs to be non-negative.

    Parameters

    Returns Decimal

  • Returns an approximation as a float type. Only use this if no exact calculation is required.

    Returns number

  • Parameters

    • atomics: string
    • fractionalDigits: number

    Returns Decimal

  • Parameters

    • input: string
    • fractionalDigits: number

    Returns Decimal

  • Creates a Decimal with value 1.0 and the given number of fractial digits.

    Fractional digits are not relevant for the value but needed to be able to perform arithmetic operations with other decimals.

    Parameters

    • fractionalDigits: number

    Returns Decimal

  • Creates a Decimal with value 0.0 and the given number of fractial digits.

    Fractional digits are not relevant for the value but needed to be able to perform arithmetic operations with other decimals.

    Parameters

    • fractionalDigits: number

    Returns Decimal

Generated using TypeDoc