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

IT: support Decimal class #605

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bryananderson
Copy link

Changes proposed in this pull request:

  • Italian language: detect non-integer cardinals regardless of whether they are float or Decimal (they will be the latter if a string is passed to num2words() rather than a float)
  • Add test for this case

Status

  • READY
  • HOLD
  • WIP (Work-In-Progress)

How to verify this change

Run tests

@bryananderson
Copy link
Author

I fixed the test/flake8 failures locally. One issue was that my change now causes 1.0 to return "uno" unstead of "uno virgola zero". However, I believe this is actually the desired behavior based on checking several other languages:

>>> num2words(1.0, lang='it')
'uno virgola zero'
>>> num2words(1.0, lang='fr')
'un'
>>> num2words(1.0, lang='de')
'eins'
>>> num2words(1.0, lang='es')
'uno'
>>> num2words(1.0, lang='en')
'one'
>>> num2words(1.0, lang='pt')
'um'

@coveralls
Copy link

Coverage Status

coverage: 98.053% (+0.001%) from 98.052%
when pulling 8e6e017 on bryananderson:italian-decimal
into 2b4d0bb on savoirfairelinux:master.

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

Successfully merging this pull request may close these issues.

2 participants