Skip to content

Commit

Permalink
Small corrections concerning the plural of millions, milliards, cents…
Browse files Browse the repository at this point in the history
… and vingts
  • Loading branch information
reboutli-crim authored and erozqba committed Sep 17, 2018
1 parent 2a99ff1 commit c71d99c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion num2words/lang_FR.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def merge(self, curr, next):
if nnum < 1000000:
return next
else:
if (not (cnum - 80) % 100 or not cnum % 100) and ctext[-1] == "s":
if (not (cnum - 80) % 100
or (not cnum % 100 and cnum < 1000))\
and nnum < 1000000 \
and ctext[-1] == "s":
ctext = ctext[:-1]
if cnum < 1000 and nnum != 1000 and \
ntext[-1] != "s" and not nnum % 100:
Expand Down
5 changes: 5 additions & 0 deletions tests/test_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@
(1000000, 'un million'),
(1000001, 'un million un'),
(4000000, 'quatre millions'),
(4000004, 'quatre millions quatre'),
(4300000, 'quatre millions trois cent mille'),
(80000000, 'quatre-vingts millions'),
(300000000, 'trois cents millions'),
(10000000000000, 'dix billions'),
(10000000000010, 'dix billions dix'),
(100000000000000, 'cent billions'),
(1000000000000000000, 'un trillion'),
(1000000000000000000000, 'un trilliard'),
Expand Down

0 comments on commit c71d99c

Please sign in to comment.