I know how to find the erc20 balance of an address. What I'm trying to find is the incoming token of a particular ERCs. For example :

for a transaction, I managed to fetch its from_address, to_address (which will be the token address), also managed to decode its data field of method transfer(_to,_value), which is :


_to is the destination address and _value is the desired amount. But what is the unit of that amount ??

In the above transaction it was 196.8 usdt transferred, but what is the standard to convert the value that is applicable to all erc20?

1 Answer 1


Within the context of smart contracts, token amounts are always denoted in integers. So, in your case, 196880000 tokens were transferred.

What makes this concept a bit tricky is the UIs which make the amount "more user friendly". In your case, the user friendly amount is 196.8.

I've earlier invented the terms absolute amount and display amount to separate these concepts. Contracts always operate on absolute amounts. To get a display amount from absolute amount, you check the amount of decimals the token has. In your case the token has 8 decimals, so you shift the decimal separator 8 spots to the left, resulting into 196.8.

Just to emphasize: the concept of decimals (and display amount) is only relevant for user interfaces. In reality always the absolute amounts are used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.