module ActiveSupport::Inflector

def ordinal(number)

ordinal(-1021) # => "st"
ordinal(-11) # => "th"
ordinal(1003) # => "rd"
ordinal(1002) # => "nd"
ordinal(2) # => "nd"
ordinal(1) # => "st"

in an ordered sequence such as 1st, 2nd, 3rd, 4th.
Returns the suffix that should be added to a number to denote the position
def ordinal(number)
  I18n.translate("number.nth.ordinals", number: number)
end