From 0e5b4914939724e96e194376bfe46977e16c2492 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Tue, 19 Mar 2024 00:14:50 +0000 Subject: [PATCH] fix formatting! --- src/cogs/quote_quota.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cogs/quote_quota.py b/src/cogs/quote_quota.py index 95541d4..c1e7d44 100644 --- a/src/cogs/quote_quota.py +++ b/src/cogs/quote_quota.py @@ -35,11 +35,15 @@ class QuoteQuota(commands.Cog): :param counts: The number of times the username appears in the chat :returns: The pie chart image """ + + def pct(v: int): + return f"{v / sum(counts) * 100:.1f}% ({v})" + fig, ax = plt.subplots() ax.pie( counts, labels=usernames, - autopct='%1.1f%% (%d)', + autopct=pct, ) fio = io.BytesIO() fig.savefig(fio, format='jpg', bbox_inches='tight')