Skip to content

Incorrect approximation for decimal numbers #603

@journpy

Description

@journpy

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions