Re: Getting the th of a Number
- Posted by DerekParnell (admin) Oct 15, 2008
- 1113 views
Oops! Correction ...
constant ordstr = "thstndrd" function ordinal(integer n) sequence res integer i res = sprintf("%d", n) i = (find(res[$], "123") + 1) * 2 - 1 res &= ordstr[ i .. i + 1] return res end function