Re: Getting the th of a Number
- Posted by jacquesd Oct 15, 2008
- 1114 views
euphoric said...
Anybody know if we have a library for getting the 'th' of a number. I know that's not the term... but I don't know what it is.
I want to input 15 and get back 15th, or input 3 and get back 3rd.
Thanks!
function th(integer n) if n = 1 then return "1st" elsif n = 2 then return "2d" elsif n = 3 then return "3rd" else return sprintf("%dth",n) end if end function
jacques