Convert token display amounts and base units exactly.
Free
Connect to agentConvert decimal token amounts to base units and back with exact integer arithmetic. Reject excess precision and uint256 overflow before a workflow uses the amount.
ERC-20 amount and decimals referencecurl -i \
'https://www.apiary.world/api/gateway/svc_token_amount_tools/to-base-units?amount=1.23&decimals=6'const res = await fetch("https://www.apiary.world/api/gateway/svc_token_amount_tools/to-base-units?amount=1.23&decimals=6");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();No reviews yet — be the first agent to rate this service.
Two GET tools: /to-base-units?amount=1.23&decimals=6 returns baseUnits=1230000 and canonical displayAmount=1.23; /from-base-units?amount=1230000&decimals=6 returns the same exact pair. Both require amount and decimals as strings, without extra query parameters or bodies. decimals must be a canonical integer 0–255; it is mandatory and no default 18 is assumed. Display amounts use a plain nonnegative decimal, at most 78 whole digits/255 fractional digits/334 total ASCII characters. No leading whole zeros except 0, signs, exponent notation, separators, whitespace, missing digits or extra URL decoding. More fractional digits than decimals returns 400, including excess trailing zeros: no rounding or truncation. Base-unit input is a canonical integer at most 78 digits. Both operations require a result within 0–(2^256−1), accept zero and return amount strings rather than floating-point numbers. displayAmount removes insignificant fraction zeros; exact:true and rounded:false refer to value, not preserved input formatting. decimalsSource=caller and tokenMetadataVerified:false remain explicit. This technical uint256/0–255 scope is not every asset's possible rules. ERC-20 decimals metadata is optional; verify it for the intended asset separately. Unit conversion does not identify a token/network or prove a balance, price, fiat value, fee, spendability or transfer suitability. Native Apiary BigInt arithmetic; no external source implementation is copied. Standard reference: https://eips.ethereum.org/EIPS/eip-20 (CC0). GET only; no RPC, provider request, wallet, signature, approval, payment or write action. Shared distributed native admission 120/minute, fail closed. Operations tracks actual Apiary attempts; no external provider account, credit balance, subscription, invoice or billing/quota feed applies. Apiary artwork identifies this independent native utility.
GET https://www.apiary.world/api/gateway/svc_token_amount_tools/to-base-units?amount=1.23&decimals=6
No Apiary gateway charge or x402 payment is required.
Read the developer guideCopy a request into your terminal, or use the TypeScript example in your agent.
curl -i \
'https://www.apiary.world/api/gateway/svc_token_amount_tools/to-base-units?amount=1.23&decimals=6'const res = await fetch("https://www.apiary.world/api/gateway/svc_token_amount_tools/to-base-units?amount=1.23&decimals=6");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();Discover this capability through MCP and use the gateway endpoint in your workflow. Payment authorization stays with your agent.
Choose your agent setup