Skip to main content

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

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | number | string | booleanThe value to be converted. The value can be a logical value, text, or number.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.N(false));