From 5c593255a7f6ce6bdaa066b5e089615adf7d01c3 Mon Sep 17 00:00:00 2001 From: Mike Shultz Date: Fri, 6 Mar 2020 16:27:33 -0700 Subject: [PATCH] fixes percent_change formatting --- bot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 7d43f64..d3fe388 100644 --- a/bot.py +++ b/bot.py @@ -156,7 +156,10 @@ class TokenData: @property def percent_change(self): self.update() - return self._percent_change + pc = str(self._percent_change) + if pc and not pc.startswith('-'): + pc = '+{}'.format(pc) + return pc @property def market_cap(self): @@ -555,7 +558,7 @@ class TelegramMonitorBot: @{}""".format( monetary_format(pdata.price), - monetary_format(pdata.percent_change), + pdata.percent_change, monetary_format(pdata.market_cap), monetary_format(pdata.volume), update.effective_user.username,