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 1 commit into
base: master
Choose a base branch
from

Conversation

bryananderson
Copy link
Contributor

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
Contributor 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

coveralls commented Dec 17, 2024

Coverage Status

coverage: 98.082%. remained the same
when pulling 2fd3eb3 on bryananderson:italian-decimal
into 5267ce1 on savoirfairelinux:master.

@mrodriguezg1991
Copy link
Contributor

I think you added the .coverage file by error , can you remove it ? thanks

@bryananderson
Copy link
Contributor Author

Oops! Removed.

@bryananderson
Copy link
Contributor Author

@mrodriguezg1991 I think this is ready now

@bryananderson
Copy link
Contributor Author

@mrodriguezg1991 I rebased on latest master to resolve the conflict. Thanks for getting the others merged!

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.

3 participants