fixed decimal point issues
This commit is contained in:
@@ -71,7 +71,7 @@ def updateStocks(api_key):
|
||||
stock_info = {}
|
||||
|
||||
for stock in data:
|
||||
stock_info[stock['symbol']] = {'current': stock['price'], 'opening': float(stock['price']) - float(stock['change_since'])}
|
||||
stock_info[stock['symbol']] = {'current': stock['price'], 'change': stock['change_since'], 'percent_change':stock['percent']}
|
||||
|
||||
print(stock_info)
|
||||
all_stocks_settings['symbols'] = stock_info
|
||||
@@ -127,7 +127,7 @@ def updateCrypto(api_key):
|
||||
symbol = d['symbol']
|
||||
base = d['currency']
|
||||
|
||||
coin_info[symbol.upper() + ',' + base.upper()] = {'current': d['price'], '24hr_change': d['percent_over_24hr']}
|
||||
coin_info[symbol.upper() + ',' + base.upper()] = {'current': d['price'], '24hr_change': d['price_over_24hr'], 'percent_change': d['percent_over_24hr']}
|
||||
|
||||
all_crypto_settings['symbols'] = coin_info
|
||||
|
||||
@@ -175,12 +175,12 @@ def updateForex(api_key):
|
||||
|
||||
|
||||
|
||||
|
||||
print(data)
|
||||
c_dict = {}
|
||||
|
||||
for d in data:
|
||||
|
||||
c_dict[d['uid'].replace('/',',')] = {'current': d['rate'], '24hr_change': d['rate_over_24hr']}
|
||||
c_dict[d['uid'].replace('/',',')] = {'current': d['rate'], '24hr_change': d['rate_over_24hr'], 'percent_change':d['percent_over_24hr']}
|
||||
|
||||
|
||||
|
||||
@@ -572,6 +572,7 @@ if __name__ == '__main__':
|
||||
api_keys = f.readlines()
|
||||
api_key = api_keys[0].strip()
|
||||
|
||||
|
||||
try:
|
||||
weather_key = api_keys[1].strip()
|
||||
except Exception as e:
|
||||
|
Reference in New Issue
Block a user