跳到主要内容

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

This example shows how to get absolute value of a number.

// How to add absolute value to the worksheet.

// Get a function that gets absolute value.

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