ordnl 1.0.3

A Rust library for formatting ordinal numbers
Documentation
  • Coverage
  • 100%
    6 out of 6 items documented6 out of 6 items with examples
  • Size
  • Source code size: 38.17 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 270.73 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • kguinto/ordnl
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kguinto

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"
}