Ordinals for All Numeric Types


Category:
Scripts
Ruby
Requirements:
Seller:
Price:
-
System:
Rating:
4.5
License:

Description - Ordinals for All Numeric Types



This Snippet will extend all numerical types with a method for returning the English ordinal, i.e. 1st, 2nd, 3rd, 4th, etc. Note that floating-point types will suffer an implicit integer coercion without rounding. The method is based on this PaGE, where you can find Similar code in short-hand style as well (not that rewriting the following in ternary Logic should prove an unsurmountable problem for anyone).



More in Ruby-Ordinals for All Numeric Types

Numeric Ordinals Numeric Types Integer Coercion Without