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.




' Nth (sans apostrophes)
FUNCTION nth$(NUMBER n) TYPE STRING
    LOCAL suffix
    IF n < 0 THEN RETURN STR$(n)
    IF MOD(n, 100) >= 11 AND MOD(n, 100) <= 13 THEN
        suffix = "th"
    ELSE
        suffix = MID$("thstndrdthththththth", MOD(n, 10) * 2 + 1, 2)
    ENDIF
    RETURN CONCAT$(STR$(n), suffix)
END FUNCTION
 
' Test a few ranges
FOR i = 1 TO 4
    READ first, last
    per = 1
    FOR n = first TO last
        PRINT nth$(n) FORMAT "%s "
        ' limit to 10 entries per line
        IF per = 10 OR n = last THEN
            per = 1
            PRINT
        ELSE
            INCR per
        ENDIF
    NEXT
NEXT
DATA 0, 25, 250, 265, 1000, 1025, -20, -11