@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 โ
| Parameter | Type |
|---|---|
amount | CircuitAmountLike |
asset | AssetInfo |
opts? | { symbol?: boolean; } |
opts.symbol? | boolean |
Returns โ
string