Browse Source

Don't display interest rate if profit is zero

It will end up showing very small and actually wrong numbers like
5.38939837311e-11 % or even -1.48880395563e-11 % if it's newly funded
wallet with no coinjoins happened yet.
master
Kristaps Kaupe 8 years ago
parent
commit
c089063a79
  1. 5
      jmclient/jmclient/wallet_utils.py

5
jmclient/jmclient/wallet_utils.py

@ -727,7 +727,10 @@ def wallet_fetch_history(wallet, options):
now = jm_single().bc_interface.rpc('getblock', [bestblockhash])['time'] now = jm_single().bc_interface.rpc('getblock', [bestblockhash])['time']
print(' %s best block is %s' % (datetime.fromtimestamp(now) print(' %s best block is %s' % (datetime.fromtimestamp(now)
.strftime("%Y-%m-%d %H:%M"), bestblockhash)) .strftime("%Y-%m-%d %H:%M"), bestblockhash))
print('total profit = ' + str(float(balance - sum(deposits)) / float(100000000)) + ' BTC') total_profit = float(balance - sum(deposits)) / float(100000000)
print('total profit = ' + str(total_profit) + ' BTC')
if abs(total_profit) > 0:
try: try:
# https://gist.github.com/chris-belcher/647da261ce718fc8ca10 # https://gist.github.com/chris-belcher/647da261ce718fc8ca10
import numpy as np import numpy as np

Loading…
Cancel
Save