Math problem

Geoff Canyon Rev gcanyon+rev at gmail.com
Fri Feb 17 18:39:00 EST 2012


My original function took the number to be rounded and the increment to
round up to, so I think your version would become:

function roundUp x,i -- rounds x up to the next i
  return x div i * i + item itemoffset((x mod i > 0),"true,false") of (i,0)
end roundUp

On Fri, Feb 17, 2012 at 1:49 PM, Peter M. Brigham, MD <pmbrig at gmail.com>wrote:

> function roundUp x
>   return trunc(x) + char itemoffset((x mod 1 > 0),"true,false") of "10"
> end roundUp
>



More information about the use-livecode mailing list