function inc

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
marialange
Posts: 20
Joined: December 12th, 2011, 12:00 pm

function inc

Post 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
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: function inc

Post 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;
marialange
Posts: 20
Joined: December 12th, 2011, 12:00 pm

Re: function inc

Post by marialange »

Thank you very much
Post Reply