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

Fixing currency functions for german and french. Adding Currency_Forms for DE, FR and NL. #247

Merged
merged 6 commits into from
Apr 11, 2019

Conversation

sarahberanek
Copy link
Contributor

@sarahberanek sarahberanek commented Apr 5, 2019

Fixes

by Sarah Beranek

Changes proposed in this pull request:

  • Adding CURRENCY_FORMS for German and French
  • Replacing old currency functions with updated ones for German and French.
  • Adding more CURRENCY_FORMS options for dutch

Status

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

How to verify this change

lang='de'                                                                                     
var1 = '49.95'                                                                                                                                 
var2 = '1.01'                                                                              
b = num2words(var1, lang=lang, to='currency', currency='USD')
print(b)                                                               
d = num2words(var2, lang=lang, to='currency', currency='EUR')
print(d) 

the same test for French with setting lang='fr' or Dutch with lang='nl'

Additional notes

I think for most of the languages if there is only an integer value given the currency should be euro/dollar and not cent per default.
I see that there is a possible option is_int_with_cents in the parse_currency_parts function to address this, which is not used yet.

Maybe it is a good idea to propagate this to the specific language to_currency functions?
If you agree - I can do the changes, if I find the time.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 662

  • 34 of 34 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 92.944%

Totals Coverage Status
Change from base Build 660: -0.01%
Covered Lines: 4864
Relevant Lines: 5142

💛 - Coveralls

1 similar comment
@coveralls
Copy link

Pull Request Test Coverage Report for Build 662

  • 34 of 34 (100.0%) changed or added relevant lines in 7 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 92.944%

Totals Coverage Status
Change from base Build 660: -0.01%
Covered Lines: 4864
Relevant Lines: 5142

💛 - Coveralls

@coveralls
Copy link

coveralls commented Apr 5, 2019

Pull Request Test Coverage Report for Build 669

  • 56 of 56 (100.0%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 92.966%

Totals Coverage Status
Change from base Build 660: 0.01%
Covered Lines: 4877
Relevant Lines: 5155

💛 - Coveralls

@sarahberanek sarahberanek changed the title Fixing currency functions for german and french. Fixing currency functions for german and french. Adding Currency_Forms for DE, FR and NL. Apr 5, 2019
@erozqba
Copy link
Collaborator

erozqba commented Apr 8, 2019

Hi @sarahberanek
Thanks a lot for your contribution! We have an small decrease in coverage, could you take a look into the missed lines and add a couple of tests to cover them? We can't merge if the coverage decrease because Github block the merge button!

@sarahberanek
Copy link
Contributor Author

Hi @erozqba - done! :)

@erozqba erozqba merged commit a869745 into savoirfairelinux:master Apr 11, 2019
@eortiz-tracktik eortiz-tracktik mentioned this pull request May 12, 2019
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