module ActiveSupport::Inflector
def ordinalize(number)
ordinalize(-11) # => "-11th"
ordinalize(1003) # => "1003rd"
ordinalize(1002) # => "1002nd"
ordinalize(2) # => "2nd"
ordinalize(1) # => "1st"
ordered sequence such as 1st, 2nd, 3rd, 4th.
Turns a number into an ordinal string used to denote the position in an
def ordinalize(number) I18n.translate("number.nth.ordinalized", number: number) end