跳到主要内容

FLOOR_MATH

Rounds a number down, to the nearest integer or to the nearest multiple of significance.

Syntax

expression.FLOOR_MATH(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe numeric value to round down.
arg2OptionalApiRange | ApiName | numberThe multiple of significance to round down to. If it is omitted, the default value of 1 is used.
arg3OptionalApiRange | ApiName | numberSpecifies if negative numbers are rounded towards or away from zero. If it is omitted or set to 0, negative numbers are rounded away from zero. If any other numeric value is specified, negative numbers are rounded towards zero.

Returns

number

Example

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

// How to round a number down to the nearest integer.

// Use function to round down a number with specified decimal points.

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.FLOOR_MATH(-5.5, 2, 1));