Skip to main content

ROUNDDOWN

Rounds a number down, toward zero.

Syntax

expression.ROUNDDOWN(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberAny real number that will be rounded down.
arg2RequiredApiRange | ApiName | numberThe 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

This example shows how to round a number down, toward zero.

// How to round a number down.

// Use a function to round a number towards zero.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.ROUNDDOWN(3.456, 0));