ordnl

Crates.ioordnl
lib.rsordnl
version1.0.3
sourcesrc
created_at2020-02-23 06:34:55.670319
updated_at2020-02-23 07:30:43.391884
descriptionA Rust library for formatting ordinal numbers
homepagehttps://crates.io/crates/ordnl
repositoryhttps://github.com/kguinto/ordnl
max_upload_size
id211664
size38,177
Kirk Louie Guinto (kguinto)

documentation

https://docs.rs/ordnl/

README

ordnl

A Rust library for formatting ordinal numbers.

Crate Docs

Usage

Add this to your Cargo.toml:

[dependencies]
ordnl = "1.0.3"

Example

use ordnl;

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"
}
Commit count: 11

cargo fmt