Crate ordinal_type

Crate ordinal_type 

Source
Expand description

This crate provides a type Ordinal<T>, that formats an integer as an ordinal number.

§Install

Command:

cargo add ordinal-type

Cargo.toml:

[dependencies]
ordinal-type = "*"

§Usage

use ordinal_type::Ordinal;

let ordinal = Ordinal(1);
assert_eq!(ordinal.to_string(), "1st");

Structs§

Ordinal

Traits§

ToOrdinal