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

Ordinal Generator #99

Open
alyx opened this issue Mar 6, 2021 · 7 comments · May be fixed by #108
Open

Ordinal Generator #99

alyx opened this issue Mar 6, 2021 · 7 comments · May be fixed by #108
Assignees
Labels
feature New feature or request

Comments

@alyx
Copy link

alyx commented Mar 6, 2021

Name About Title Labels Assignees
Feature Request Number formatting Ordinal Generator feature @alyx

Is your feature request related to a problem? Please describe.
As a plugin developer, I want to call a function to find the correct ordinal for an individual number in an ordered list - e.g. ordinal(3) -> 3rd or ordinal(3) -> 'rd' - so that I can easily ensure my ordered lists are grammatically correct without manually duplicating the logic calls for finding the correct value each time.

Describe the solution you'd like
A method, either on the existing NumberUtil, or as part of the new math module to perform this function.

@alyx alyx added the feature New feature or request label Mar 6, 2021
@alyx alyx self-assigned this Mar 6, 2021
@aakatz3
Copy link
Collaborator

aakatz3 commented Mar 6, 2021

Strongly consider https://medium.com/@d.lopez.j/real-life-java-from-numbers-to-localized-text-ordinals-using-icu4j-f8146d64b0fd

@alyx
Copy link
Author

alyx commented Mar 6, 2021

Gonna have to cc @SkyezerFox for this one.

ICU4J looks incredibly powerful and could be used to our benefit elsewhere in the future, imo, but I'm not sure if pulling in an additional dependency is optimal if we're only using it for this one small thing.

@aakatz3
Copy link
Collaborator

aakatz3 commented Mar 8, 2021

We should consider where ICU4J can be used, and, if there is enough, use it directly, and implement it.

@ZachyFoxx
Copy link
Member

👍

@ZachyFoxx
Copy link
Member

Ordinal Generator

@kaylendog
Copy link
Collaborator

This is maybe 6 lines of code. No deps needed.

@kaylendog kaylendog self-assigned this Apr 24, 2021
@kaylendog kaylendog linked a pull request Apr 24, 2021 that will close this issue
@kaylendog
Copy link
Collaborator

Added an ordinal generator in commit f495c46 - comments appreciated.

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

Successfully merging a pull request may close this issue.

4 participants