Write a function/method/subroutine/... that when given an integer greater than or equal to zero returns a string of the number followed by an apostrophe then the ordinal suffix.



Example

Returns would include 1'st 2'nd 3'rd 11'th 111'th 1001'st 1012'th



Task

Use your routine to show here the output for at least the following (inclusive) ranges of integer inputs:
0..25, 250..265, 1000..1025


Note: apostrophes are now optional to allow correct apostrophe-less English.




ordinal = function(n)
    if n > 3 and n < 20 then return n + "th"
    if n % 10 == 1 then return n + "st"
    if n % 10 == 2 then return n + "nd"
    if n % 10 == 3 then return n + "rd"
    return n + "th"
end function
 
out = []
test = function(from, to)
    for i in range(from, to)
        out.push ordinal(i)
    end for
end function
 
test 0, 25
test 250, 265
test 1000, 1025
print out.join