rank

Functions

pub fn ordinalise(number: Int) -> String

Convert a number to its ordinal form.

Examples

ordinalise(1) // -> "1st"
ordinalise(2) // -> "2nd"
ordinalise(3) // -> "3rd"
ordinalise(4) // -> "4th"
pub fn suffix(number: Int) -> String

Returns the ordinal suffix for a number.

Examples

suffix(1) // -> "st"
suffix(2) // -> "nd"
suffix(3) // -> "rd"
suffix(4) // -> "th"
Search Document