instance method
ordinal
Ruby on Rails edge
Since v4.0.13Signature
ordinal()
Ordinal returns the suffix used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
“‘ 1.ordinal # => “st” 2.ordinal # => “nd” 1002.ordinal # => “nd” 1003.ordinal # => “rd” -11.ordinal # => “th” -1001.ordinal # => “st” “`
Source
# File activesupport/lib/active_support/core_ext/integer/inflections.rb, line 32
def ordinal
ActiveSupport::Inflector.ordinal(self)
end
Defined in activesupport/lib/active_support/core_ext/integer/inflections.rb line 32
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in Integer