fix crypto sigfigs

This commit is contained in:
iou1name 2018-12-31 01:20:25 -05:00
parent 7c906ff595
commit 036200f1f7

View File

@ -25,7 +25,7 @@ def crypto(bot, trigger):
symbol = trigger.group(3) symbol = trigger.group(3)
if symbol: if symbol:
params["symbol"] = symbol params["symbol"] = symbol
res = requests.get(URI + "/coin", params = params) res = requests.get(URI + "/coin", params=params)
if res.status_code in [400, 401]: if res.status_code in [400, 401]:
return bot.msg(f"Error: {res.json()['error']}") return bot.msg(f"Error: {res.json()['error']}")
res.raise_for_status() res.raise_for_status()
@ -34,7 +34,7 @@ def crypto(bot, trigger):
msg += f"\x0310Symbol\x03: \x0312{data['show_symbol']}\x03 | " msg += f"\x0310Symbol\x03: \x0312{data['show_symbol']}\x03 | "
msg += f"\x0310Rank\x03: \x0312{data['rank']}\x03 | " msg += f"\x0310Rank\x03: \x0312{data['rank']}\x03 | "
msg += f"\x0310Price\x03: \x0308" msg += f"\x0310Price\x03: \x0308"
msg += re.sub(r'(^.+\.\d\d).*', r'\1', data['price']) + "\x03 | " msg += data['price'] + "\x03 | "
msg += f"\x0310Markets\x03: \x0312{len(data['markets'])}\x03 | " msg += f"\x0310Markets\x03: \x0312{len(data['markets'])}\x03 | "
msg += f"\x0310Market Cap\x03: \x0308" msg += f"\x0310Market Cap\x03: \x0308"
msg += re.sub(r'(^.+\.\d\d).*', r'\1', data['market_cap']) + "\x03" msg += re.sub(r'(^.+\.\d\d).*', r'\1', data['market_cap']) + "\x03"