aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Xithrius <[email protected]>2020-09-21 19:21:36 -0700
committerGravatar GitHub <[email protected]>2020-09-21 19:21:36 -0700
commit912bfe00dc8edbb3795dc93485a8a871ccf9997c (patch)
tree5c550c72f6548a0f44c221329a5528a7d687bf74
parentComment updated from "microseconds" to "seconds" (diff)
Replacing the round function with a format specifier.
Co-authored-by: Dennis Pham <[email protected]>
-rw-r--r--bot/exts/utils/ping.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/exts/utils/ping.py b/bot/exts/utils/ping.py
index f26817159..ea67a7b16 100644
--- a/bot/exts/utils/ping.py
+++ b/bot/exts/utils/ping.py
@@ -32,7 +32,7 @@ class Latency(commands.Cog):
# datetime.datetime objects do not have the "milliseconds" attribute.
# It must be converted to seconds before converting to milliseconds.
bot_ping = (datetime.utcnow() - ctx.message.created_at).total_seconds() / 1000
- bot_ping = f"{round(bot_ping, ROUND_LATENCY)} ms"
+ bot_ping = f"{bot_ping:.{ROUND_LATENCY}f} ms"
try:
delay = await aioping.ping(URLs.site, family=socket.AddressFamily.AF_INET) * 1000