Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: timonkGood Day,
In BRAINScript, there is a function for evaluating to the smallest integer greater or equal to a parameter: "ceil"
If you look in your BRAINScript Help (you can reach this from BRE under the Help menu), under the Numeric Operators section you fill see the "ceil" function
CEIL:
Finds the ceiling of a number: Evaluates to the smallest integer greater than or equal ot the parameter.
ceil(num) or num.ceil()
So for example:
ceil(1.01) = 2.0
2.3.ceil() = 3.0
ceil(4.56) = 5.0
ceil(5) = 5.0
Now, if you want these to be integers, you can simply combine with the "int" function
int(ceil(1.0.1)) = 2
int(2.3.ceil()) = 3
I recommend reviewing your BRAINScript help for more information on the various functions provided.
Regards
Timon Koufopoulos
MDA Support