-
Notifications
You must be signed in to change notification settings - Fork 488
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
Fixed issues with wrong text for currency in Polish language #58
Conversation
Hi @kszys |
I added the unittests, but the checks seem to fail... The tests worked fine, when I tested locally - not sure what I need to do now... |
Hi @kszys For more information, you can look at https://travis-ci.org/savoirfairelinux/num2words/jobs/205850020
Thanks in advance if you can look at it and fix it. |
Ok. It seems I have not tested with python 3 :) |
This should do it :) |
num2words/lang_PL.py
Outdated
right = n % 100 | ||
else: | ||
n = str(n).replace(',', '.') | ||
if '.' in n: | ||
left, right = n.split('.') | ||
if len(right)==1: | ||
right = right+'0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add whitespace around the operators? So we keep respecting PEP8?
if len(right) == 1:
and right = right + '0'
Hi @kszys thanks for your work! We will change tox in the future so it will automatically check for PEP8 |
So when is this going to be pushed in a new version of the module that I can install with |
Yes, @hsoft is usually in charge of the releases, he will probably make a new one when he finds some free time. 👍 |
When the amount to be converted to text using to_currency function in Polish language was ending with a number of decimals being a whole 10 - e.g., 11.30, 123.40, 34234.80, etc. the resulting text was saying respectively three, four, eight (in Polish) rather than thirty, forty, eighty. This was because the same conversion was used for regular numbers as for cents, which is incorrect. This patch fixes it for Polish language.