Short answer: USDC on Algorand has 6 decimals, so divide the base-unit amount by 1,000,000. Keep the base units as a BigInt and only convert for display.
// algod = new algosdk.Algodv2("", "https://testnet-api.algonode.cloud", 443)
// indexer, addr (an account address) and USDC (asset id 10458941 on TestNet) are set up before the call
async () => {
const { assetHolding } = await algod.accountAssetInformation(addr, USDC).do();
const base = BigInt(assetHolding.amount);
const dollars = Number(base / 10000n) / 100; // 6 decimals: 1 USDC = 1_000_000 base units
return { baseUnits: String(base), usdc: dollars };
}
{
"baseUnits": "1825001",
"usdc": 1.82
}
Run against a public TestNet node with algosdk 3.9.0 on 2026-12-03. Amounts are shown as strings because they are bigints.
All how-tos · howto.json · SDK errors · API errors · costs