3 releases (breaking)

0.3.0 Apr 20, 2023
0.2.0 Apr 20, 2023
0.1.0 Apr 16, 2023

#1 in #formats

29 downloads per month

MIT license

28KB
399 lines

Ordinal Type

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");

lib.rs:

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");

Dependencies

~205KB