Download MetaTrader 5

Always round up to nearest integer

To add comments, please log in or register
Melted
16
Melted  

I have a division where I need to always have a rounded UP integer: 

numPositions=(int)round(bet/inMaxLot);

But this just rounds up/down normally, so how could I rewrite it so that it always rounds up?

 

Hope you guys can help me :) 

Alain Verleyen
Moderator
33337
Alain Verleyen  
MathCeil()
Melted
16
Melted  
I don't really understand the MathCeil(), so could you please write how it would look?
Melted
16
Melted  
Nevermind... I figured it out :)
To add comments, please log in or register