Function get_ordinal_suffix

Source
pub fn get_ordinal_suffix(n: usize) -> &'static str
Expand description

Gets the appropriate ordinal suffix for a number (e.g., “st”, “nd”, “rd”, “th”).

§Examples

assert_eq!(get_ordinal_suffix(1), "st");
assert_eq!(get_ordinal_suffix(22), "nd");