Skip to main content

FLOOR

Rounds a number down to the nearest multiple of significance.

Syntax

expression.FLOOR(arg1, arg2);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe numeric value to round down.
arg2RequiredApiRange | ApiName | numberThe multiple of significance to round down to. The number to round down and the multiple of significance must have the same sign.

Returns

number

Example

Round a number down to the nearest multiple of a specified value in a spreadsheet.

// How do I round a number down to a specific increment in a spreadsheet?

// Decrease a number to the nearest multiple of a given significance in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.FLOOR(5.786, 0.7));