Skip to content

Failing for 1000 decillion #86

@NavisGames

Description

@NavisGames

What did you do?

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 code which is followed below

What actually happened?, What did you expect to happen?

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

That the user has so much money is basically impossible, but just to be safe that if the user has more than the amount of numbers,
i want to see if its changeable / fixable

What versions are you using?

  • OS: Windows 10
  • Python: Python 3.10
  • Humanize: 4.40

Please include code that reproduces the issue.

The best reproductions are self-contained scripts with minimal dependencies.

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"
    }
}

It could be the code of mine too, but i expect it to be a issue of humanize OR it could be because humanize dont support above googol? I dont know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions