fixed trailing zeros for crypto
This commit is contained in:
parent
2534f18495
commit
3d7da19b3c
@ -1025,8 +1025,17 @@ class StockTicker():
|
|||||||
arrow, change = self.getArrow(point_change)
|
arrow, change = self.getArrow(point_change)
|
||||||
|
|
||||||
percent_change = '%.2f' % abs(percent_change) + '%'
|
percent_change = '%.2f' % abs(percent_change) + '%'
|
||||||
point_change = str(point_changefinal)
|
num3 = point_changefinal.split('.')
|
||||||
current = str(current_final)
|
if len(num3[1]) <= 1:
|
||||||
|
point_change = '%.2f' % float(point_changefinal)
|
||||||
|
else:
|
||||||
|
point_change = str(point_changefinal)
|
||||||
|
|
||||||
|
num2 = current_final.split('.')
|
||||||
|
if len(num2[1]) <= 1:
|
||||||
|
current = '%.2f' % float(current_final)
|
||||||
|
else:
|
||||||
|
current = str(current_final)
|
||||||
|
|
||||||
if not all_crypto_settings['percent']:
|
if not all_crypto_settings['percent']:
|
||||||
percent_change = False
|
percent_change = False
|
||||||
@ -1189,9 +1198,18 @@ class StockTicker():
|
|||||||
# convert percent to points
|
# convert percent to points
|
||||||
change = '%.2f' % abs(float(coin_info[cb]['percent_change'])) + '%'
|
change = '%.2f' % abs(float(coin_info[cb]['percent_change'])) + '%'
|
||||||
else:
|
else:
|
||||||
change = str(changefinal)
|
num3 = changefinal.split('.')
|
||||||
|
if len(num3[1]) <= 1:
|
||||||
current = str(current_final)
|
change = '%.2f' % float(changefinal)
|
||||||
|
else:
|
||||||
|
change = str(changefinal)
|
||||||
|
|
||||||
|
num2 = current_final.split('.')
|
||||||
|
if len(num2[1]) <= 1:
|
||||||
|
current = '%.2f' % float(current_final)
|
||||||
|
else:
|
||||||
|
current = str(current_final)
|
||||||
|
|
||||||
midFrame = self.textToImageProf(ticker + '(' + base + ')', current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
|
midFrame = self.textToImageProf(ticker + '(' + base + ')', current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
|
||||||
if all_crypto_settings['logos']:
|
if all_crypto_settings['logos']:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user