Re: Getting the th of a Number

new topic     » goto parent     » topic index » view thread      » older message » newer message

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 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu