savoirfairelinux / num2words

Modules to convert numbers to words. 42 --> forty-two
GNU Lesser General Public License v2.1
820 stars 497 forks source link

Update lang_DE: in to_currency "eine " for Mark(DEM) & Lira (ITL) #470

Open m-f-h opened 2 years ago

m-f-h commented 2 years ago

Currently, the "exception handling" in to_currency() replaces "...eins " by "...ein " which is correct for Euro, Dollar, Franken, cents, Pfennig, but it must be "...eine " for Mark (DEM, other Marks?) and for ital. Lira (ITL), maybe others ("Sesterze" doesn't exist any more, but....)? See.

Fixes issue #462 reported by @rillig and patch #469 of the test cases.

Changes proposed in this pull request:

How to verify this change

Run test cases, or manually to_currency(value = 1.00, lang = "de", currency = "DEM) # must yield "eine Mark" -- correctly produced by patched code of course only provided that patch #469 by @m-f-h is included !! see there for more info

Additional notes

See also issue #462 reported by @rillig

For the moment I "hard-wired" DEM and ITL (Italian Lira) which are feminine and therefore require "eine", not "ein" in German. Maybe one could use if currency in FEMININE_CURRENCIES and define a set or tuple `FEMININE_CURRENCIES = {"DEM","ITL"}, esp. if there are more to come.