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
Convert any value to a number in a spreadsheet.
// Transform values into numeric form for calculations in a spreadsheet.
// Change boolean values and dates into numbers in a spreadsheet.
let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.N(false));