lib/powercore/integer.rb
# Returns the ordinal of the number.
Returns the ordinal of the number.
Returns the ordinal of the number .
def ordinal
    self.to_s +
      if (11..13).include?(self % 100)
        "th"
      else
        case self % 10
        when 1 then "st"
        when 2 then "nd"
        when 3 then "rd"
        else "th"
        end
      end
  end
def ordinal self . to_s + if ( 11 .. 13 ) . include? ( self % 100 ) "th" else case self % 10 when 1 then "st" when 2 then "nd" when 3 then "rd" else "th" end end end
Returns the ordinal of the number.
Returns the ordinal of the number .