Re: round

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

Hello ©koda,

>Could someone give me better round function, that rounds number.
>1.4 to 1, 1.6 to 2.
>-1.7 to -2 etc
>
>I  have written this one, but can't remeber how to do it better, simpler.

I think this will do what you want if I'm understanding your
question correctly:

function round (object x)
  return floor (x + 0.5)
end function

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu