tokenString method

String tokenString(
  1. int decimals
)

Format BigInt to string with decimals parameter

Implementation

String tokenString(int decimals) {
  Decimal value = Decimal.fromBigInt(this);
  Decimal decimalValue =
      (value / Decimal.fromInt(10).pow(decimals).toDecimal()).toDecimal();
  return decimalValue.toString();
}