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

Function to convert a positive integer to an ordinal text #137

Open
Seddryck opened this issue Dec 28, 2022 · 0 comments
Open

Function to convert a positive integer to an ordinal text #137

Seddryck opened this issue Dec 28, 2022 · 0 comments
Labels
extension This feature should be supported by an extension (other package)

Comments

@Seddryck
Copy link
Owner

The basic idea of the function ordinal(culture) is to convert 1 to 1st, 2 to 2nd, 3 to 3rd, 4 to 4th, 11 to 11th ...

It should accept an optional parameter, the culture (i.e. en-US, fr-fr, ...) by default it applies en-GB.

11 | ordinal  => 11th
11 | ordinal(en-us)  => 11th
11 | ordinal(fr-fr)  => 11e
11 | ordinal(nl-be)  => 11de
11 | ordinal(pt-pt) => 11º

More info on https://github.com/BenjaminVanRyseghem/numbro/tree/develop/languages

@Seddryck Seddryck added new-feature Request for a new feature in the tool extension This feature should be supported by an extension (other package) and removed new-feature Request for a new feature in the tool labels Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension This feature should be supported by an extension (other package)
Projects
None yet
Development

No branches or pull requests

1 participant