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.




 
loLim = 0
hiLim = 25
PrintImages()
loLim = 250
hiLim = 265
PrintImages()
loLim = 1000
hiLim = 1025
PrintImages()
 
Sub PrintImages
  For i = loLim To hiLim
    nr = i
    GetSuffix()
    TextWindow.Write(i + suffix + " ")
  EndFor
  TextWindow.WriteLine("")
EndSub  
 
Sub GetSuffix
  rem10  = Math.Remainder(nr, 10)  
  rem100 = Math.Remainder(nr, 100)
  If rem10 = 1 And rem100 <> 11 Then
    suffix = "st"
  ElseIf rem10 = 2 And rem100 <> 12 Then
    suffix = "nd"
  ElseIf rem10 = 3 And rem100 <> 13 Then
    suffix = "rd"
  Else
    suffix = "th"
  EndIf      
EndSub
 