#formatting #identifier #fn #misc

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

#1012 in Rust patterns

Download history 765/week @ 2023-02-09 644/week @ 2023-02-16 422/week @ 2023-02-23 500/week @ 2023-03-02 735/week @ 2023-03-09 606/week @ 2023-03-16 678/week @ 2023-03-23 602/week @ 2023-03-30 481/week @ 2023-04-06 558/week @ 2023-04-13 551/week @ 2023-04-20 628/week @ 2023-04-27 388/week @ 2023-05-04 651/week @ 2023-05-11 605/week @ 2023-05-18 743/week @ 2023-05-25

2,461 downloads per month
Used in 10 crates (6 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

~205KB