Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect approximation for decimal numbers #603

Open
journpy opened this issue Dec 13, 2024 · 0 comments
Open

Incorrect approximation for decimal numbers #603

journpy opened this issue Dec 13, 2024 · 0 comments

Comments

@journpy
Copy link

journpy commented Dec 13, 2024

I expected num2words(98_746_251_323_029.99) to return 'ninety-eight trillion, seven hundred and forty-six billion, two hundred and fifty-one million, three hundred and twenty-three thousand and twenty-nine point nine nine'

but it returns 'ninety-eight trillion, seven hundred and forty-six billion, two hundred and fifty-one million, three hundred and twenty-three thousand and twenty-nine point nine eight'

I tried using the decimal module instead of float num2words(Decimal(98_746_251_323_029.99)) but it returned the same result 'ninety-eight trillion, seven hundred and forty-six billion, two hundred and fifty-one million, three hundred and twenty-three thousand and twenty-nine point nine eight'

Is this an approximation with the library? How do I get correct approximation for decimal values like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant