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

✨ Programmatically determine long_form for en #8

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

E1337Kat
Copy link
Contributor

For EN only (I started adding the other langs, but there are certain nuances that I don't quite get). Programmatically determine the long form ordinalized version of a given number. Should work for any signed integer supported by ruby. I did not test what happens if you try it with numbers larger than whatever MAX_INT would be, but I would assume things would break well before this point if using such numbers in a real system.

I also capitalized the numbers. not sure if that is the best route for it or not.

I dashed the combined numbers like "Twenty-Three" and "Ninety-Nine" since that seems to be the accepted method for long form numbers.

In theory, the work here could also be used to write both fractions in long form as well since we basically use the ordinalized version of the decimal part (e.g. "1/10" is "One Tenth")

@infertux infertux merged commit 1077ccc into infertux:master Sep 27, 2023
0 of 5 checks passed
@infertux
Copy link
Owner

This is very nice, thank you! I fixed some Ruby linting issues and merged your PR.

In theory, the work here could also be used to write both fractions in long form as well since we basically use the ordinalized version of the decimal part (e.g. "1/10" is "One Tenth")

Good point, I don't think anyone has requested this feature so far but it should easy enough to add whenever the need arises.

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

Successfully merging this pull request may close these issues.

2 participants