mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
[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:
@@ -2,6 +2,7 @@ import importlib.machinery
|
||||
|
||||
import discord
|
||||
|
||||
from redbot.core.utils.chat_formatting import humanize_number
|
||||
from .i18n import Translator
|
||||
|
||||
_ = Translator(__name__, __file__)
|
||||
@@ -45,8 +46,8 @@ class BalanceTooHigh(BankError, OverflowError):
|
||||
self.currency_name = currency_name
|
||||
|
||||
def __str__(self) -> str:
|
||||
return _("{user}'s balance cannot rise above {max:,} {currency}.").format(
|
||||
user=self.user, max=self.max_balance, currency=self.currency_name
|
||||
return _("{user}'s balance cannot rise above max {currency}.").format(
|
||||
user=self.user, max=humanize_number(self.max_balance), currency=self.currency_name
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user