Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Decimal

A type for arbitrary precision, non-negative decimals.

Instances of this class are immutable.

Hierarchy

  • Decimal

Index

Accessors

atomics

  • get atomics(): string

fractionalDigits

  • get fractionalDigits(): number

Methods

plus

  • a.plus(b) returns a+b.

    Both values need to have the same fractional digits.

    Parameters

    Returns Decimal

toFloatApproximation

  • toFloatApproximation(): number
  • Returns an approximation as a float type. Only use this if no exact calculation is required.

    Returns number

toString

  • toString(): string

Static fromAtomics

  • fromAtomics(atomics: string, fractionalDigits: number): Decimal

Static fromUserInput

  • fromUserInput(input: string, fractionalDigits: number): Decimal

Generated using TypeDoc