Hi,

My variable is the number of plant (i.e. 3.2 plants) and I would like to round it up to the next integer (i.e. 4 plants). This is to calculate the capital cost (number of plant x capital cost per plant) as we cannot build 3.2 plants.

At the same time, this variable need to keep as decimal point for the next equation that calculate the operating cost (number of plant x capacity per plant x operating cost per capacity) as some plant can run without in full capacity.

Hope someone can help.

Many thanks,

Jun Keat

## Round variable up to the next whole number (integer)

### Re: Round variable up to the next whole number (integer)

If the number of plants is in the objective function and the problem structure naturally favors minimizing it, you can define an integer variable p and add a constraint p =g= number_of_plants;

This way, if the number of plants is 3.2, p will be 4; if the number of plants is 3, p will be 3.

This way, if the number of plants is 3.2, p will be 4; if the number of plants is 3, p will be 3.

### Re: Round variable up to the next whole number (integer)

Thanks for your solution. I'm really appreciate it.