ROUND
function ROUND(arg1: number = null, arg2: number = null): number | string | boolean
Description
Rounds a number to a specified number of digits.
Parameters
- arg1
number
null Is the number you want to round.
- arg2
number
null Is the number of digits to which you want to round. Negative rounds to the left of the decimal point; zero to the nearest integer.
Returns
number | string | boolean
Try It
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.ROUND(3.456, 2));