Token unit converter
util_unitsUse when an agent must turn an on-chain integer into a human amount, or back, without losing money to rounding: converts between wei, gwei, ether and any token decimals with exact integer maths, no floating point. Being off by a factor of a thousand on decimals is the mistake that costs real funds. Do not use to find a token's decimals (/v1/evm/token-info returns them). No API key, no account. $0.005 per call, paid over x402 (USDC).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | wei | gwei | ether, or a number of decimals. | |
| from | Yes | wei | gwei | ether, or a number of decimals. | |
| amount | Yes | The quantity, as a string to avoid float loss. |