Token Balance Decimals

Balance Decimals

Noting my python code for reference. If familiar with crypto currency tokens you may find the token balance does not have decimals but rather store the decimal value separately.

For example this query shows the balance:

$ curl -s\?apiKey\=freekey | jq -r '.tokens[0].balance' 

If you look at the token detail you see the decimals recorded:

$ curl -s\?apiKey\=freekey | jq -r '.tokens[0].tokenInfo.decimals'

More on the decimals here:
The Technology Behind Ethereum Tokens

For my python3 code I used as follow:

$ python3                                                                                                                         
Python 3.8.6 (default, Jan 27 2021, 15:42:20) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1001193304561787500000*10**-18


Bio Info for Riaan