From 367fab669f421fa186b1b408d3e3d5ff6f02bdc1 Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Sat, 27 Mar 2021 18:24:33 -0700 Subject: [PATCH] Coin formatting for price reply --- cg_Crypto.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cg_Crypto.py b/cg_Crypto.py index 9a1bc0d..56c3f99 100644 --- a/cg_Crypto.py +++ b/cg_Crypto.py @@ -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