From c1937a67c4bec6553304190cf810b6637d5178d0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 5 Nov 2022 05:06:33 +0200 Subject: [PATCH] fix 0.0001 days being displayed as "0 days" --- files/routes/admin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index 13071d0ad..0d9f051d4 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -957,7 +957,8 @@ def ban_user(user_id, v): duration = "permanently" if days: - days_txt = str(days).split('.0')[0] + days_txt = str(days) + if days_txt.endswith('.0'): days_txt = days_txt[:-2] duration = f"for {days_txt} day" if days != 1: duration += "s" if reason: text = f"@{v.username} (Admin) has banned you for **{days_txt}** days for the following reason:\n\n> {reason}" @@ -1018,7 +1019,8 @@ def agendaposter(user_id, v): duration = "permanently" if days: - days_txt = str(days).split('.0')[0] + days_txt = str(days) + if days_txt.endswith('.0'): days_txt = days_txt[:-2] duration = f"for {days_txt} day" if days != 1: duration += "s" if reason: text = f"@{v.username} (Admin) has chudded you for **{days_txt}** days for the following reason:\n\n> {reason}"