Humanize number fix (#6283)

Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
aikaterna
2024-01-03 16:13:26 -08:00
committed by GitHub
parent 47a267b38b
commit 531b4fe357
6 changed files with 26 additions and 5 deletions

View File

@@ -8,6 +8,9 @@ __all__ = ("finite_float",)
_ = Translator("Trivia", __file__)
MAX_VALUE = 2**63 - 1
def finite_float(arg: str) -> float:
try:
ret = float(arg)

View File

@@ -8,6 +8,7 @@ from redbot.core import bank, errors
from redbot.core.i18n import Translator
from redbot.core.utils.chat_formatting import box, bold, humanize_list, humanize_number
from redbot.core.utils.common_filters import normalize_smartquotes
from .converters import MAX_VALUE
from .log import LOG
__all__ = ["TriviaSession"]
@@ -320,6 +321,7 @@ class TriviaSession:
if not winners or num_humans < 3:
return
payout = int(top_score * multiplier / len(winners))
payout = MAX_VALUE if payout > MAX_VALUE else payout
if payout <= 0:
return
for winner in winners: