Ordinals (1st, 2nd, 3rd etc) for Rust
This crate provides a type Ordinal<T>
that formats an Integer
type T
as
an ordinal number (1st, 2nd, 3rd etc).
[]
= "0.2"
Example
use Ordinal;
This crate provides a type Ordinal<T>
that formats an Integer
type T
as
an ordinal number (1st, 2nd, 3rd etc).
[dependencies]
ordinal = "0.2"
use ordinal::Ordinal;
fn main() {
assert_eq!("2nd", Ordinal(2).to_string());
}