The CEIL function in ProBuilder language is used to round a numeric value up to the nearest integer or to a specified number of decimal places. This function is particularly useful when you need to ensure that a number is rounded upwards, regardless of whether the fractional part is less than or equal to 0.5.
ceil(var, digits)
Here, var is the variable or number you want to round up. The digits parameter is optional and specifies the number of decimal places to which the number should be rounded. If digits is omitted, the function rounds the number to the nearest whole integer.
a = 3.14159
b = ceil(a) // b will be 4
c = ceil(a, 2) // c will be 3.15
In this example, variable a has a value of 3.14159. When using ceil(a), it rounds the number up to the nearest whole number, which is 4. When using ceil(a, 2), it rounds the number up to two decimal places, resulting in 3.15.
Understanding the CEIL function can help in various programming scenarios where precise rounding rules are required, ensuring that calculations are always rounded up to the desired precision.