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.




#lang racket
(define (teen? n) (<= 11 (modulo n 100) 19))
(define (Nth n)
  (format
   "~a'~a" n
   (match* ((modulo n 10) n)
     [((or 1 2 3) (? teen?)) 'th] [(1 _) 'st] [(2 _) 'nd] [(3 _) 'rd] [(_ _) 'th])))
 
(for ((range (list  (in-range 26) (in-range 250 266) (in-range 1000 1026))))
  (displayln (string-join (for/list ((nth (sequence-map Nth range))) nth) " ")))