savoirfairelinux / num2words

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

[de] wrong test case 'ein Mark' #462

Open rillig opened 2 years ago

rillig commented 2 years ago

Expected Behaviour

'1 DM' => 'eine Mark und null Pfennig' '21 DM' => 'einundzwanzig Mark und null Pfennig' '101 DM' => 'einhunderteine Mark und null Pfennig'

For feminine words like 'Mark', the numeral is 'eine' instead of 'ein'. This rule only applies if n mod 100 == 1, but not if n mod 100 == 21, then it is 'einundzwanzig Mark und null Pfennig'.

Actual Behaviour

'1 DM' => 'ein Mark und null Pfennig'

Steps to reproduce

m-f-h commented 2 years ago

So I have fixed this in my patch #470 which needs to be reviewed to validate the pull request. I did further research and noticed that in addition to DEM (Deutsche Mark) and ITL (Italian Lira), the same applies to FIM (Finnische Mark), TRY & MTL (Turkish & Maltesian Lira). These could just be added in the tuple ("DEM","ITL") I've introduced, or the whole could be defined as a variable (attribute of the class). But it seems I can't to further edits to the file since I made a pull request for the current version...

rillig commented 2 years ago

There are some more currencies that are feminine in German. See https://de.m.wikipedia.org/wiki/ISO_4217 for an easily clickable list. Basically all of the following: