跳到主要内容

ISEVEN

如果数字为偶数,则返回 true

语法

expression.ISEVEN(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | number要测试的值。

返回值

boolean

示例

此示例演示如何在数字为偶数时返回 true。

// How to check if the number is even.

// Use a function to check whether a number is even or not.

const worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
let result = func.ISEVEN("66");
worksheet.GetRange("C3").SetValue(result)