round
Round to the nearest integer (or to a specified number of digits).
Syntax
Section titled “Syntax”Y = round(X) % script modeY = round(X, digits) % Excel-compatible modeDescription
Section titled “Description”In script mode, returns each element of X rounded to the nearest integer using banker’s-style nearest rounding.
In Excel-compatible mode, the optional digits argument controls the rounding precision: positive values round to fractional digits, negative values round to tens, hundreds, etc.
Examples
Section titled “Examples”round(3.4) % 3round(3.5) % 4round(-2.5) % -3round(123.456, 2) % 123.46 (Excel-compat)round(123.456, -1) % 120 (Excel-compat)