Skip to content

@lelantos-org/sdk / index / formatAmount

Function: formatAmount() โ€‹

ts
function formatAmount(
   amount, 
   asset, 
   opts?
): string;

Defined in: @lelantos-org/sdk/dist/wallet/assets.d.ts:69

Circuit units โ†’ human decimal string. Pass { symbol: true } to append the token symbol when one is known.

ts
formatAmount(wallet.balance(weth.id), weth, { symbol: true }); // "0.25 WETH"

Parameters โ€‹

ParameterType
amountCircuitAmountLike
assetAssetInfo
opts?{ symbol?: boolean; }
opts.symbol?boolean

Returns โ€‹

string

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub