Crate ordnl

Source
Expand description

A Rust library for formatting ordinal numbers.

§Example


fn main() {
    println!("{}", ordnl::of_u8(0u8)); // "0th"
    println!("{}", ordnl::of_u8(1u8)); // "1st"
    println!("{}", ordnl::of_u8(2u8)); // "2nd"
    println!("{}", ordnl::of_u8(3u8)); // "3rd"
    println!("{}", ordnl::of_u8(4u8)); // "4th"

    println!("{}", ordnl::of_u8(0u8)); // "0th"
    println!("{}", ordnl::of_u16(1u16)); // "1st"
    println!("{}", ordnl::of_u32(2u32)); // "2nd"
    println!("{}", ordnl::of_u64(3u64)); // "3rd"
    println!("{}", ordnl::of_u128(4u128)); // "4th"
}

Functions§

of_u8
Ordinalizes a u8 integer.
of_u16
Ordinalizes a u16 integer.
of_u32
Ordinalizes a u32 integer.
of_u64
Ordinalizes a u64 integer.
of_u128
Ordinalizes a u128 integer.