You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting numbers like 0.000001 to strings, python prints it as 1e-06, leading to problems with the result. For example:
>>>importinflect>>>p=inflect.engine()
>>>p.number_to_words(0.000001)
'one hundred and six'>>>p.number_to_words('0.000001')
'zero point zero zero zero zero zero one'>>>0.0000011e-06
One approach is to use string formatting for floating point numbers:
The text was updated successfully, but these errors were encountered:
xenova
changed the title
[bug] Incorrect results for floating point numbers. p.number_to_words(0.000001) = 'one hundred and six'
[bug] Incorrect results for floating point numbers. p.number_to_words(0.000001) != 'one hundred and six'Dec 3, 2024
When converting numbers like 0.000001 to strings, python prints it as 1e-06, leading to problems with the result. For example:
One approach is to use string formatting for floating point numbers:
The text was updated successfully, but these errors were encountered: