1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! English ordinal suffixes (`1st`, `2nd`, `3rd`, `4th`, …).
use format;
use String;
use crateInteger;
/// Format an integer with its English ordinal suffix: `1` → `"1st"`,
/// `22` → `"22nd"`, `113` → `"113th"`.
///
/// Negative numbers keep their sign (`-1` → `"-1st"`). The suffix is chosen from
/// the magnitude, so `-21` → `"-21st"`.
///
/// # Note
///
/// `u128`/`usize` inputs above `i128::MAX` (~1.7e38) saturate to `i128::MAX`
/// before formatting. This is unreachable on 64-bit platforms and far outside any
/// realistic ordinal use.