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

NumberToWordsConverter gives different result for different languages #154

Open
giangianoulas opened this issue Jan 30, 2024 · 1 comment
Labels

Comments

@giangianoulas
Copy link

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
Copy link
Author

Actually it seems i miss used the code :)
Closing it, please reject the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant