Title / Description
Code Number.prototype.ordinalize = function() { var abs = Math.abs(this); if (abs % 100 >= 11 && abs % 100 <= 13) { return this + 'th'; } abs = abs % 10; if (abs === 1) { return this + 'st'; } if (abs === 2) { return this + 'nd'; } if (abs === 3) { return this + 'rd'; } return this + 'th'; };
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code