Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Aaron

Aaron Avatar
Bad Wolf

****
Dedicated Studio Member

859


November 2006
Description: Adds "st," "nd," "rd," "th" suffixes to numbers.

Syntax: (152).suffix()

Number.prototype.suffix = function(a) {
return this + [ "th", "st", "nd", "rd" ][((a = this % 10) < 4) * (Math.floor(this % 100 / 10) != 1) * a];
}

newBookmarkLockedFalling