View Single Post
Old 11-25-2003, 10:02 PM   PM User | #15
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Hmm, sounds like an interesting challenge - I'll throw together my own version:
Code:
Number.prototype.ordinal=function(){
    var
        nModTen = this % 10;
    return (this + ['th','st','nd','rd'][nModTen > 3 ?
        0 :
        ( this % 100 - nModTen != 10) * nModTen]);
}
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

Last edited by liorean; 11-25-2003 at 10:16 PM..
liorean is offline   Reply With Quote