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

#125 in Internationalization (i18n)

Download history 729/week @ 2023-11-21 1710/week @ 2023-11-28 2066/week @ 2023-12-05 2087/week @ 2023-12-12 1640/week @ 2023-12-19 1436/week @ 2023-12-26 1329/week @ 2024-01-02 1206/week @ 2024-01-09 1363/week @ 2024-01-16 1937/week @ 2024-01-23 1676/week @ 2024-01-30 1817/week @ 2024-02-06 1722/week @ 2024-02-13 1507/week @ 2024-02-20 1938/week @ 2024-02-27 974/week @ 2024-03-05

6,639 downloads per month
Used in 11 crates (8 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

~210KB