tradukisto icon indicating copy to clipboard operation
tradukisto copied to clipboard

NumberToWordsConverter gives different result for different languages

Open giangianoulas opened this issue 1 year ago • 1 comments

Hi

If I do something like this

NumberToWordsConverter conv = new NumberToWordsConverter(Container.englishContainer().getIntegerConverter(), 
new EnglishValues().pluralForms());
return conv.asWords(3750); //== > The result will be "three thousand seven hunder..." this is correct

But if i do this If i i do something like this

NumberToWordsConverter conv = new NumberToWordsConverter(Container.czechContainer().getIntegerConverter(), 
new CzechValues().pluralForms());
return conv.asWords(3750); //== > The result will be "tri milliony sedm .... this is wrong, a whole order of magnitude wrong

I found the problem to be that in CzechValues::pluralForms

//No default entry exists
return Arrays.asList(new CzechPluralForms("tisíc", "tisíce", "tisíc", GenderType...);

//In contrast one exist for English
return Arrays.asList(new EnglishPluralForms(""), new EnglishPluralForms("thousand"),

Same applies error for German and other languages

giangianoulas avatar Jan 30 '24 11:01 giangianoulas