From c5035e6b388b7765afeecce2ae7e34e24229c411 Mon Sep 17 00:00:00 2001 From: scoobybejesus Date: Thu, 4 Jan 2018 10:00:15 -0500 Subject: [PATCH] Round top for >100B --- price.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/price.py b/price.py index fd9038c..7a46f94 100644 --- a/price.py +++ b/price.py @@ -383,7 +383,10 @@ def top(bot, trigger): price_btc = float(i['price_btc']) market_cap_usd = float(i['market_cap_usd']) if market_cap_usd >= 1000000000: - market_cap_short = int(int(round(market_cap_usd,-9))/int(1000000000)) + if market_cap_usd >= 100000000000: + market_cap_short = int(int(round(market_cap_usd,-9))/int(1000000000)) + else: + market_cap_short = float(int(round(market_cap_usd,-8))/int(1000000000)) rounded_mcap = str(market_cap_short)+"B" else: rounded_mcap = "tiny"