ROUNDDOWN
Rounds a number down, toward zero.
Syntax
expression.ROUNDDOWN(arg1, arg2);
expression - A variable that represents a ApiWorksheetFunction class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| arg1 | Required | ApiRange | ApiName | number | Any real number that will be rounded down. | |
| arg2 | Required | ApiRange | ApiName | number | The number of digits to round to. If this argument is negative, the number will be rounded to the left of the decimal point. If it is equal to zero, the number will be rounded to the nearest integer. |
Returns
number
Example
Round a number down to the nearest integer in a spreadsheet.
// How do I round numbers down while keeping decimals in a spreadsheet?
// Decrease a number to its lower whole number or specified decimal place in a spreadsheet.
let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.ROUNDDOWN(3.456, 0));