2 decimal places for stocks
This commit is contained in:
parent
2991b4e407
commit
b320c49505
@ -1242,12 +1242,12 @@ class StockTicker():
|
|||||||
|
|
||||||
arrow, change = self.getArrow(change)
|
arrow, change = self.getArrow(change)
|
||||||
|
|
||||||
percent_change = str(abs(float(info['percent_change']))) + '%'
|
percent_change = '%.2f' % abs(float(info['percent_change'])) + '%'
|
||||||
point_change = str(abs(change))
|
point_change = '%.2f' % abs(change)
|
||||||
|
|
||||||
print(percent_change, point_change)
|
print(percent_change, point_change)
|
||||||
|
|
||||||
current = str(float(info['current'])) #TEXT
|
current = '%.2f' % float(info['current']) #TEXT
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1325,12 +1325,12 @@ class StockTicker():
|
|||||||
arrow, change = self.getArrow(change, professional=True)
|
arrow, change = self.getArrow(change, professional=True)
|
||||||
|
|
||||||
if all_stocks_settings["percent"]:
|
if all_stocks_settings["percent"]:
|
||||||
change = str(abs(float(info['percent_change']))) + '%'
|
change = '%.2f' % abs(float(info['percent_change'])) + '%'
|
||||||
else:
|
else:
|
||||||
change = str(abs(change))
|
change = '%.2f' % abs(change)
|
||||||
|
|
||||||
|
|
||||||
current = str(float(info['current'])) #TEXT
|
current = '%.2f' % float(info['current']) #TEXT
|
||||||
midFrame = self.textToImageProf(ticker, current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
|
midFrame = self.textToImageProf(ticker, current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
|
||||||
|
|
||||||
if all_stocks_settings['logos']:
|
if all_stocks_settings['logos']:
|
||||||
|
Loading…
Reference in New Issue
Block a user