#ordinal

ordinal

Formatting of ordinals (1st, 2nd, 3rd etc)

8 releases

0.3.2 Jan 31, 2022
0.3.1 Jan 26, 2022
0.2.3 Jun 16, 2020
0.2.2 Aug 7, 2018
0.1.0 Apr 11, 2016

#136 in Internationalization (i18n)

Download history 1435/week @ 2024-12-16 508/week @ 2024-12-23 712/week @ 2024-12-30 1081/week @ 2025-01-06 1472/week @ 2025-01-13 1848/week @ 2025-01-20 1954/week @ 2025-01-27 2952/week @ 2025-02-03 2284/week @ 2025-02-10 2201/week @ 2025-02-17 2222/week @ 2025-02-24 1319/week @ 2025-03-03 1695/week @ 2025-03-10 1506/week @ 2025-03-17 1305/week @ 2025-03-24 2375/week @ 2025-03-31

6,920 downloads per month
Used in 10 crates (7 directly)

MPL-2.0 license

9KB
135 lines

Ordinals (1st, 2nd, 3rd etc) for Rust

test lint

This crate provides a type Ordinal<T> that formats an Integer type T as an ordinal number (1st, 2nd, 3rd, etc).

Install

Just add the following line to your Cargo.toml file:

[dependencies]
ordinal = "0.3.2"

Example

use ordinal::Ordinal;

fn main() {
    assert_eq!("2nd", Ordinal(2).to_string());
}

Ownership Context

I am not the original author of this crate. The original author, @dtolnay, didn't want to maintain the crate anymore so he gave it to me. This means that I am the official maintainer of this package. If you want to see where this decision was made check the GitHub issue.

Dependencies

~200KB