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);