gill

tokenAmountToUiAmount

function tokenAmountToUiAmount(amount, decimals): number;

Converts a raw amount (BigInt) to UI amount (human-readable)

Note: This function does not support token balances that utilize the various "UI amount modifying" Token Extensions, like the Interest-Bearing extension.

Parameters

ParameterTypeDescription
amountbigintThe raw token amount as BigInt
decimalsnumberThe number of decimals for the token

Returns

number

UI representation of the amount as a number

On this page