Page 1 of 1

rounding decimal to nearest integer

Posted: Thu Aug 06, 2009 3:36 pm
by ernenazira
Hi,

I have a problem with the value of my variable. This variable is supposed to be discrete. As a result of the equation used in this variable, I got decimal values. I tried to use INTEGER but it does not return the value that I required. Example:

X= 3.155, INTEGER (X)= 2
Y= 3.985, INTEGER (Y)= 3

The values that I need are:

X= 3
Y= 4

Do you have any suggestion on this? Many thanks..

Posted: Thu Aug 06, 2009 4:39 pm
by Administrator
You could use INTEGER(value+ 0.5)