Class: Numeric
- Inherits:
-
Object
- Object
- Numeric
- Defined in:
- lib/rocker.rb
Overview
To other
Instance Method Summary collapse
Instance Method Details
#ordinalize ⇒ Object
77 78 79 80 81 82 83 84 |
# File 'lib/rocker.rb', line 77 def ordinalize n= self.to_s s= n[-2]=='1' ? 'th' : n[-1]=='1' ? 'st' : n[-1]=='2' ? 'nd' : n[-1]=='3' ? 'rd' : 'th' n + s end |