math.round Function |
The math.round function rounds a given expression to the nearest whole number integer value.
math.round(expr);
expr | Required. An expression to round to the nearest whole number |
The nearest whole-number integer value to the given expression.
PRINT math.round(3.142); /* 3 */ PRINT math.round(0.707); /* 1 */
The int function rounds a number down (never up) to the nearest integer.