From 73d11530ae48f340f3c15254b4d25413d786a3f9 Mon Sep 17 00:00:00 2001 From: Nils Date: Sat, 1 Jul 2017 09:04:23 +0200 Subject: [PATCH] wei to ether comment --- plugins/currency/ethereum/etherscan_balance_ | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/currency/ethereum/etherscan_balance_ b/plugins/currency/ethereum/etherscan_balance_ index b00eac76..53ecd34a 100755 --- a/plugins/currency/ethereum/etherscan_balance_ +++ b/plugins/currency/ethereum/etherscan_balance_ @@ -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));