Page 1 of 1

function inc

Posted: February 29th, 2012, 7:27 am
by marialange
Hello,
I could say as I can take the integer part of a division but with rounding?
example:
int (5/3) = 1, but 5/3 = 1.66 or 2, the function leaves with 1 int but I want it to round 2 ..
Thanks

Re: function inc

Posted: March 1st, 2012, 5:29 pm
by Gregory Martin
You could write a user-defined function that will round all of your values. The trick to doing this is to add 0.5 to the value and then call the int function.
function round(value)

    round =
int(value + 0.5);

end;

Re: function inc

Posted: March 2nd, 2012, 6:40 am
by marialange
Thank you very much