Getting rid of scientific notation for crypto and forex
increased DP
This commit is contained in:
parent
f5c34048fa
commit
ff0e33d3b2
@ -937,7 +937,9 @@ class StockTicker():
|
|||||||
ticker, base = cb.split(',')
|
ticker, base = cb.split(',')
|
||||||
current = float(coin_info[cb]["current"])
|
current = float(coin_info[cb]["current"])
|
||||||
point_change = float(coin_info[cb]["24hr_change"])
|
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"])
|
percent_change = float(coin_info[cb]["percent_change"])
|
||||||
|
|
||||||
|
|
||||||
@ -945,8 +947,8 @@ 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(abs(point_change))
|
point_change = str(point_changefinal)
|
||||||
current = str(current)
|
current = str(current_final)
|
||||||
|
|
||||||
if not all_crypto_settings['percent']:
|
if not all_crypto_settings['percent']:
|
||||||
percent_change = False
|
percent_change = False
|
||||||
@ -1016,7 +1018,10 @@ class StockTicker():
|
|||||||
try:
|
try:
|
||||||
ticker, base = cb.split(',')
|
ticker, base = cb.split(',')
|
||||||
current = float(coin_info[cb]["current"])
|
current = float(coin_info[cb]["current"])
|
||||||
|
current_final = '{0:.10f}'.format(current).rstrip("0")
|
||||||
change = float(coin_info[cb]["24hr_change"])
|
change = float(coin_info[cb]["24hr_change"])
|
||||||
|
change2 = abs(change)
|
||||||
|
changefinal = '{0:.10f}'.format(change2).rstrip("0")
|
||||||
arrow, change = self.getArrow(change, professional=True)
|
arrow, change = self.getArrow(change, professional=True)
|
||||||
|
|
||||||
if all_crypto_settings["percent"]:
|
if all_crypto_settings["percent"]:
|
||||||
@ -1024,9 +1029,9 @@ class StockTicker():
|
|||||||
change = '%.2f' % abs(float(coin_info[cb]['percent_change'])) + '%'
|
change = '%.2f' % abs(float(coin_info[cb]['percent_change'])) + '%'
|
||||||
else:
|
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
|
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:
|
||||||
@ -1083,12 +1088,14 @@ class StockTicker():
|
|||||||
symbol, base = sb.split(',')
|
symbol, base = sb.split(',')
|
||||||
|
|
||||||
current = float(forex_settings[sb]['current'])
|
current = float(forex_settings[sb]['current'])
|
||||||
|
current_final = '{0:.10f}'.format(current).rstrip("0")
|
||||||
change = float(forex_settings[sb]['24hr_change'])
|
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'])) +'%'
|
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']:
|
if not all_forex_settings['percent']:
|
||||||
percent_change = False
|
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
|
midFrame = self.textToImage(symbol+ '(' + base + ')', current, arrow, percent_change, point_change) #IMAGE THE TEXT
|
||||||
@ -1175,8 +1182,11 @@ class StockTicker():
|
|||||||
symbol, base = sb.split(',')
|
symbol, base = sb.split(',')
|
||||||
|
|
||||||
current = float(forex_settings[sb]['current'])
|
current = float(forex_settings[sb]['current'])
|
||||||
|
current_final = '{0:.10f}'.format(current).rstrip("0")
|
||||||
change = float(forex_settings[sb]['24hr_change'])
|
change = float(forex_settings[sb]['24hr_change'])
|
||||||
|
change2 = abs(change)
|
||||||
|
changefinal = '{0:.10f}'.format(change2).rstrip("0")
|
||||||
|
|
||||||
arrow, change = self.getArrow(change, professional = True)
|
arrow, change = self.getArrow(change, professional = True)
|
||||||
|
|
||||||
|
|
||||||
@ -1188,8 +1198,8 @@ class StockTicker():
|
|||||||
|
|
||||||
change = '%.2f' % change + '%'
|
change = '%.2f' % change + '%'
|
||||||
else:
|
else:
|
||||||
change = str(abs(change))
|
change = str(changefinal)
|
||||||
current = str(current)
|
current = str(current_final)
|
||||||
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']:
|
||||||
|
Loading…
Reference in New Issue
Block a user