https://github.com/lpil/rank
Ordinals for numbers, e.g. 1st, 2nd, 3rd
https://github.com/lpil/rank
Last synced: 4 months ago
JSON representation
Ordinals for numbers, e.g. 1st, 2nd, 3rd
- Host: GitHub
- URL: https://github.com/lpil/rank
- Owner: lpil
- Created: 2023-12-30T17:24:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-15T18:29:31.000Z (about 2 years ago)
- Last Synced: 2025-01-22T05:42:14.260Z (over 1 year ago)
- Language: Gleam
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# rank
Ordinals for numbers, e.g. 1st, 2nd, 3rd
[](https://hex.pm/packages/rank)
[](https://hexdocs.pm/rank/)
```sh
gleam add rank
```
```gleam
import rank
pub fn main() {
rank.ordinalise(1) // "1st"
rank.ordinalise(2) // "2nd"
rank.ordinalise(3) // "3rd"
rank.suffix(1) // "st"
rank.suffix(2) // "nd"
rank.suffix(3) // "rd"
}
```
Documentation can be found at .
Thanks to [Andrew Hao's Ordinal](https://github.com/andrewhao/ordinal) which
was the inspiration for this library.