Crates.io | ordinal |
lib.rs | ordinal |
version | 0.3.2 |
source | src |
created_at | 2016-04-11 00:55:33.74275 |
updated_at | 2022-01-31 03:26:32.770675 |
description | Formatting of ordinals (1st, 2nd, 3rd etc) |
homepage | |
repository | |
max_upload_size | |
id | 4723 |
size | 24,179 |
This crate provides a type Ordinal<T>
that formats an Integer
type T
as an ordinal number (1st, 2nd, 3rd, etc).
Just add the following line to your Cargo.toml
file:
[dependencies]
ordinal = "0.3.2"
use ordinal::Ordinal;
fn main() {
assert_eq!("2nd", Ordinal(2).to_string());
}
I am not the original author of this crate. The original author, @dtolnay, didn't want to maintain the crate anymore so he gave it to me. This means that I am the official maintainer of this package. If you want to see where this decision was made check the GitHub issue.