Skip to main content

ABS

Returns the absolute value of a number, a number without its sign.

Syntax

expression.ABS(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | numberThe real number for which the absolute value will be returned.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.ABS(-123.14));