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

Triple zero output for numbers ending with double zero #124

Closed
florushj opened this issue Aug 23, 2023 · 5 comments · Fixed by #125
Closed

Triple zero output for numbers ending with double zero #124

florushj opened this issue Aug 23, 2023 · 5 comments · Fixed by #125
Labels
bug Something isn't working

Comments

@florushj
Copy link

Using the default config for multiple languages (NL, EN, DE) (I did not test all) makes numbers ending with double zeros output to a value with triple zeros.

Faulty tests in EN:

  • 100.00 should output: "one hundred point zero zero". But outputs: "one hundred point zero zero zero"
  • 1234.00 should output: "one thousand two hundred and thirty-four point zero zero". But outputs: "one thousand two hundred and thirty-four point zero zero zero"

It only happens for numbers ending with double zero. Correct tests in EN:

  • 102.02 should output: "one hundred and two point zero two" and it does so correctly.
@forzagreen forzagreen added the bug Something isn't working label Aug 23, 2023
@TylerVigario
Copy link
Collaborator

Thank you for reporting this. I'll take a look later and hopefully resolve this today.

@TylerVigario
Copy link
Collaborator

I can see how https://github.com/forzagreen/n2words/blame/ab74750586e77b63ac3b1ec073c74495c916fa2d/lib/classes/AbstractLanguage.js#L87 would create a 0 from the remaining output ("") in these events. I am working on a fix, but it may take until this weekend.

@TylerVigario
Copy link
Collaborator

TylerVigario commented Aug 27, 2023

Merged in #125 and will put out a release later today. Thanks again for reporting!

@florushj
Copy link
Author

Had a quick look at the changes, and it seems like this would fix it indeed. Will test and check out the new code once it is released. Thanks for all your hard work and rapid response!

@forzagreen
Copy link
Owner

Released in v1.17.0 🎉
Thank you @florushj for reporting, and thank you @TylerVigario for fixing !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants