formatValue static method

String formatValue(
  1. BigInt value,
  2. int decimals
)

Formats a token amount to a string representation.

value - The amount in its smallest unit (BigInt). decimals - The number of decimal places for the token.

Returns the string representation of the token amount (String).

Implementation

static String formatValue(
  BigInt value,
  int decimals,
) {
  Decimal formattedValue = fromWei(value, decimals);
  return formattedValue.toString();
}