Open bwala-eightfold opened 9 months ago
It looks like integers are being shifted left by two decimal places. It seems to be an undocumented feature. For floats (and decimals) there's no this behavior.
from num2words import num2words
num2words(100_020.56, to='currency')
Out[10]: 'one hundred thousand and twenty euro, fifty-six cents'
num2words(100_020.56, to='currency', currency='USD')
Out[11]: 'one hundred thousand and twenty dollars, fifty-six cents'
num2words(100_020., to='currency', currency='USD')
Out[12]: 'one hundred thousand and twenty dollars, zero cents'
num2words(100_020, to='currency', currency='USD')
Out[13]: 'one thousand dollars, twenty cents'
num2words(10_000_020, to='currency', currency='USD')
Out[14]: 'one hundred thousand dollars, twenty cents'
num2words(100_020, to='currency')
Out[15]: 'one thousand euro, twenty cents'
num2words(100_020., to='currency')
Out[16]: 'one hundred thousand and twenty euro, zero cents'from decimal import Decimal
num2words(Decimal(100_020), to='currency')
Out[18]: 'one hundred thousand and twenty euro, zero cents'
cc @szymon-borkowski
Expected Behaviour
lang = en_US, Currency = USD Function used -> num2words(100020, to='currency', currency='USD', lang='en_US') 100020 -> 'one hundred thousand dollars'
Actual Behaviour
lang = en_US, Currency = USD Function used -> num2words(100020, to='currency', currency='USD', lang='en_US') 100020 -> 'one thousand dollars, twenty cents'
Mentioned above
Steps to reproduce
Steps are shown above