Find the 'st, 'nd, or 'th of a value

stndth(x)

Arguments

x

a value you want the 'st, 'nd, or 'th of

Value

a character string of the appropriate 'st, 'nd, or 'th

Examples

stndth(3)
#> [1] "rd"
stndth(11)
#> [1] "st"
stndth(112)
#> [1] "nd"
stndth(x = c(1120, 12))
#> [1] "th" "nd"