跳到主要内容

ECMA_CEILING

将数字向上舍入到最接近的基数倍数。负数向零方向舍入。

语法

expression.ECMA_CEILING(arg1, arg2);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number要向上舍入的值。
arg2必需ApiRange | ApiName | number要向上舍入到的基数的倍数。

返回值

number

示例

此示例演示如何将数字向上舍入到最接近的基数倍数。负数向零方向舍入。

// How to round up the number.

// Use function to round up a number to the nearest multiple of significance.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.ECMA_CEILING(1.567, 0.1));