[Utils] Add humanize_number() function to chat formatting (#2836)

This adds babel as a dependency, and also includes `redbot.core.i18n.get_babel_locale()`
This commit is contained in:
Draper
2019-08-27 23:44:52 +01:00
committed by Toby Harradine
parent 6c3a3fea66
commit 3c1b6ae4cf
15 changed files with 238 additions and 80 deletions

View File

@@ -6,7 +6,7 @@ from collections import Counter
import discord
from redbot.core import bank
from redbot.core.i18n import Translator
from redbot.core.utils.chat_formatting import box, bold, humanize_list
from redbot.core.utils.chat_formatting import box, bold, humanize_list, humanize_number
from redbot.core.utils.common_filters import normalize_smartquotes
from .log import LOG
@@ -292,7 +292,7 @@ class TriviaSession:
" for coming first."
).format(
user=winner.display_name,
num=amount,
num=humanize_number(amount),
currency=await bank.get_currency_name(self.ctx.guild),
)
)