mirror of
https://gitlab.com/simple-stock-bots/simple-stock-bot.git
synced 2025-06-15 23:06:40 +00:00
Coin formatting for price reply
This commit is contained in:
parent
6ab7f2c25d
commit
367fab669f
@ -134,18 +134,18 @@ class cg_Crypto:
|
||||
except KeyError:
|
||||
return f"{symbol} returned an error."
|
||||
|
||||
message = f"The current coin price of {name} is $**{price}**"
|
||||
message = f"The current coin price of {name} is $**{price:,}**"
|
||||
|
||||
# Determine wording of change text
|
||||
if change > 0:
|
||||
message += f", the coin is currently **up {change}%**"
|
||||
message += f", the coin is currently **up {change:.3f}%** for today"
|
||||
elif change < 0:
|
||||
message += f", the coin is currently **down {change}%**"
|
||||
message += f", the coin is currently **down {change:.3f}%** for today"
|
||||
else:
|
||||
message += ", the coin hasn't shown any movement today."
|
||||
|
||||
else:
|
||||
message = f"The symbol: {symbol} was not found."
|
||||
message = f"The Coin: {symbol.name} was not found."
|
||||
|
||||
return message
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user