removed decimal place formatting from fontend

This commit is contained in:
Neythen Treloar 2022-02-21 19:06:40 +00:00
parent 1872899226
commit 5368e5b09b

View File

@ -1071,10 +1071,10 @@ class StockTicker():
current = float(forex_settings[sb]['current']) current = float(forex_settings[sb]['current'])
change = float(forex_settings[sb]['24hr_change']) change = float(forex_settings[sb]['24hr_change'])
percent_change = '%.2f' % abs(change) +'%' percent_change = str(abs(change)) +'%'
point_change = '%.2f' % abs(change/100 * current) point_change = str(abs(change/100 * current))
if not all_forex_settings['percent']: if not all_forex_settings['percent']:
percent_change = False percent_change = False
@ -1164,10 +1164,10 @@ class StockTicker():
# convert percent to points # convert percent to points
change = change/current * 100 change = change/current * 100
change = '%.2f' % change + '%' change = str(change) + '%'
else: else:
change = '%.6f' % change change = str(change)
current = '%.3f' % current current = str(current)
midFrame = self.textToImageProf(symbol + '(' + base + ')', current, change, arrow, font = ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT midFrame = self.textToImageProf(symbol + '(' + base + ')', current, change, arrow, font = ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
if all_forex_settings['logos']: if all_forex_settings['logos']:
@ -1237,13 +1237,13 @@ class StockTicker():
change = float(info['current'])-float(info['opening']) #TEXT change = float(info['current'])-float(info['opening']) #TEXT
ticker = symbol #TEXT ticker = symbol #TEXT
percent_change = '%.2f' % abs(float(change)/float(info['current'])*100) + '%' percent_change = str(abs(float(change)/float(info['current'])*100)) + '%'
point_change = '%.2f' % abs(change) point_change = str(abs(change))
arrow, change = self.getArrow(change) arrow, change = self.getArrow(change)
print(percent_change, point_change) print(percent_change, point_change)
current = '%.2f' % float(info['current']) #TEXT current = str(float(info['current'])) #TEXT
@ -1324,10 +1324,10 @@ class StockTicker():
# convert percent to points # convert percent to points
change = change/float(info['current'])* 100 change = change/float(info['current'])* 100
change = '%.2f' % change + '%' change = str(change) + '%'
else: else:
change = '%.2f' % change change = str(change)
current = '%.2f' % float(info['current']) #TEXT current = str(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']: