跳到主要内容

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

This example shows how to round a number down to the nearest multiple of significance.

// How to round a number down to the nearest multiple of significance.

// Use function to round down.

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