Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Int

Represents Integer values. Used mainly to store integer values of Coin and Coins.

Note: Do not use to work with values greater than 9999999999999999999. This implementation is based on the decimal.js library, and returns Int values for only Int.add, Int.sub, Int.mul, Int.div, and Int.mod. For other methods inherited from Decimal, you will need to convert back to Int to remain compatible for submitting information that requires Int format back to the blockchain.

Example:

const int = new Int(1.5);

const decimal = int.pow(3);
const int2 = new Int(decimal);

Hierarchy

  • _Int
    • Int

Implements

Index

Constructors

constructor

  • new Int(arg?: Value): Int

Methods

add

div

mod

mul

sub

toDec

toString

  • toString(): string