Getting rid of scientific notation for crypto and forex

increased DP
This commit is contained in:
Justin 2022-06-12 17:28:48 +08:00 committed by GitHub
parent f5c34048fa
commit ff0e33d3b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -937,7 +937,9 @@ class StockTicker():
ticker, base = cb.split(',')
current = float(coin_info[cb]["current"])
point_change = float(coin_info[cb]["24hr_change"])
point_change2 = abs(point_change)
point_changefinal = '{0:.10f}'.format(point_change2).rstrip("0")
current_final = '{0:.10f}'.format(current).rstrip("0")
percent_change = float(coin_info[cb]["percent_change"])
@ -945,8 +947,8 @@ class StockTicker():
arrow, change = self.getArrow(point_change)
percent_change = '%.2f' % abs(percent_change) + '%'
point_change = str(abs(point_change))
current = str(current)
point_change = str(point_changefinal)
current = str(current_final)
if not all_crypto_settings['percent']:
percent_change = False
@ -1016,7 +1018,10 @@ class StockTicker():
try:
ticker, base = cb.split(',')
current = float(coin_info[cb]["current"])
current_final = '{0:.10f}'.format(current).rstrip("0")
change = float(coin_info[cb]["24hr_change"])
change2 = abs(change)
changefinal = '{0:.10f}'.format(change2).rstrip("0")
arrow, change = self.getArrow(change, professional=True)
if all_crypto_settings["percent"]:
@ -1024,9 +1029,9 @@ class StockTicker():
change = '%.2f' % abs(float(coin_info[cb]['percent_change'])) + '%'
else:
change = str(abs(change))
change = str(changefinal)
current = str(current)
current = str(current_final)
midFrame = self.textToImageProf(ticker + '(' + base + ')', current, change, arrow, font=ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
if all_crypto_settings['logos']:
try:
@ -1083,12 +1088,14 @@ class StockTicker():
symbol, base = sb.split(',')
current = float(forex_settings[sb]['current'])
current_final = '{0:.10f}'.format(current).rstrip("0")
change = float(forex_settings[sb]['24hr_change'])
change2 = abs(change)
changefinal = '{0:.10f}'.format(change2).rstrip("0")
percent_change = '%.2f' % abs(float(forex_settings[sb]['percent_change'])) +'%'
point_change = str(abs(change))
point_change = str(changefinal)
if not all_forex_settings['percent']:
percent_change = False
@ -1099,7 +1106,7 @@ class StockTicker():
current = str(current)
current = str(current_final)
midFrame = self.textToImage(symbol+ '(' + base + ')', current, arrow, percent_change, point_change) #IMAGE THE TEXT
@ -1175,8 +1182,11 @@ class StockTicker():
symbol, base = sb.split(',')
current = float(forex_settings[sb]['current'])
current_final = '{0:.10f}'.format(current).rstrip("0")
change = float(forex_settings[sb]['24hr_change'])
change2 = abs(change)
changefinal = '{0:.10f}'.format(change2).rstrip("0")
arrow, change = self.getArrow(change, professional = True)
@ -1188,8 +1198,8 @@ class StockTicker():
change = '%.2f' % change + '%'
else:
change = str(abs(change))
current = str(current)
change = str(changefinal)
current = str(current_final)
midFrame = self.textToImageProf(symbol + '(' + base + ')', current, change, arrow, font = ImageFont.load("./fonts/6x10.pil")) #IMAGE THE TEXT
if all_forex_settings['logos']: