rounding decimal to nearest integer

Use this forum to post Vensim related questions.
Post Reply
ernenazira
Junior Member
Posts: 4
Joined: Thu Aug 23, 2007 7:43 pm

rounding decimal to nearest integer

Post 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..
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

You could use INTEGER(value+ 0.5)
Post Reply