Returns the integer nearest to the given number , n. If the given number is equidistant between two integers (ends in ".5") the function rounds towards the nearest even integer .
You can also use the floor() or ceiling() functions to convert a number into an Integer .
round ( n As Number ) As Integer
Argument | Type | Description |
---|---|---|
n | number | The number to round. |
Intent >round(0.7) --> 1
Intent >round(-1.5) --> -2Because -1.5 was exactly between -1 and -2, the function rounded to the nearest even integer, -2.