Python Humanizing is failing at numbers above a googol

71 Views Asked by At

So, i am using Humanize in Python and Nextcord for a discord bot to shorten my Numbers with many zeros in a json file. When i am humanizing it with following code:

import humanize

def humanizing(num):
    num = humanize.intword(num)
    num = num.replace(".0", "")
    return num



@client.command()
async def account(ctx, player: nextcord.Member = None):
    if player is None:
        player = ctx.author
    await open_account(player)
    await check(player)
    user = player
    users = await get_bank_data()
    wallet_amt = users[str(user.id)]["Wallet"]
    print(humanizing(wallet_amt))
{
    "593456006160318464": {
        "Wallet": 1000000000000000000000000000000000000,
        "Bank": 0,
        "Bounty": 0,
        "Username": "Navis"
    }
}

and the user has 1000000000000000000000000000000000000 money, it says 0 googol instead of 1 googol. Adding more Zeroes will cause a failure and say then like 10000 decillion

Does Humanize just break at this point or is it because of me? These Code snippets are the important stuff for the problem. If you need more of my code tell me!

0

There are 0 best solutions below