跳到主要内容

ISODD

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

语法

expression.ISODD(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

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

返回值

boolean

示例

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

// How to check if the number is odd.

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

const worksheet = Api.GetActiveSheet();

let func = Api.WorksheetFunction;
let result = func.ISODD("94");
worksheet.GetRange("C3").SetValue(result);