N
Converts a value to a number, dates to serial numbers, -true to 1, error to ErrorValue, anything else to 0 (zero).
Syntax
expression.N(arg1);
expression
- A variable that represents a ApiWorksheetFunction class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
arg1 | Required | ApiRange | ApiName | number | string | boolean | The value to be converted. The value can be a logical value, text, or number. |
Returns
number
Example
- Code
- Result
let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.N(false));