Skip to content

Instantly share code, notes, and snippets.

@benhoskings
Created December 17, 2008 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save benhoskings/36955 to your computer and use it in GitHub Desktop.
Save benhoskings/36955 to your computer and use it in GitHub Desktop.
class Integer
def to_ord
self.to_s + ((10...20) === self ? 'th' : %w{th st nd rd th th th th th th}[int % 10])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment