1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-25 10:28:36 +00:00

wei to ether comment

This commit is contained in:
Nils 2017-07-01 09:04:23 +02:00
parent 311888d3b8
commit 73d11530ae

View file

@ -103,5 +103,13 @@ except:
print("JSON result error!", file=sys.stderr)
sys.exit(9)
"""
API result is in Wei. Convert Wei to Ether (ETH).
1 : Wei
10^12 : Szabo
10^15 : Finney
10^18 : Ether
233874700000000000000000 Wei = 233,874.7 Ether
"""
eth = float(etherscan_balance['result']) / 1000000000000000000
print("{}.value {:.2f}".format(eth_address, eth));