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

Traits