Class BigNum

Hierarchy

  • BigNum

Constructors

Properties

precision: BN
val: BN
delim: string = '.'
spacer: string = ','

Methods

  • Parameters

    • Optional useTradePrecision: boolean
    • Optional precisionOverride: number

    Returns string

  • Pretty print the underlying value in human-readable form. Depends on precision being correct for the output string to be correct

    Returns

    Returns string

  • Print and remove unnecessary trailing zeroes

    Returns

    Parameters

    • Optional useTradePrecision: boolean
    • Optional precisionOverride: number

    Returns string

  • Shift precision up or down

    Returns

    Parameters

    • exponent: number | BN
    • skipAdjustingPrecision: boolean = false

    Returns BigNum

  • Pretty print with the specified number of decimal places

    Returns

    Parameters

    • fixedPrecision: number
    • rounded: boolean = false

    Returns string

  • Returns {
        precision: string;
        val: string;
    }

    • precision: string
    • val: string
  • Parameters

    • precision: number = 3
    • rounded: boolean = false
    • type: "financial" | "scientific" = 'financial'

    Returns string

  • Print dollar formatted value. Defaults to fixed decimals two unless a given precision is given.

    Returns

    Parameters

    • Optional useTradePrecision: boolean
    • Optional precisionOverride: number

    Returns string

  • Get the numerical value of the BigNum. This can break if the BigNum is too large.

    Returns

    Returns number

  • Pretty print to the specified number of significant figures

    Returns

    Parameters

    • fixedPrecision: number
    • trailingZeroes: boolean = false
    • rounded: boolean = false

    Returns string

  • Parameters

    • Optional base: number | "hex"
    • Optional length: number

    Returns string

  • Create a BigNum instance

    Returns

    Parameters

    • val: string | number | BN = ZERO
    • Optional precision: string | number | BN

    Returns BigNum

  • Parameters

    • json: {
          precision: string;
          val: string;
      }
      • precision: string
      • val: string

    Returns BigNum

Generated using TypeDoc