: After quite some optimisation, you could end up with a function looking something like this:
return (this +
((m=this%10) >3) ||
and you use it like this:
sFirstOrdinal=nNumber.toOrdinal(), // => '12th'
sSecondOrdinal=(22).toOrdinal(); // => '22nd'
Well, I won't bore you with the development procedure of this very slick and optimised function. You can check it out yourself in this thread