Creator Help

abs

This topic describes the syntax and usage of the abs() function in Zoho Creator .

Description

The abs function returns the absolute value of a number. The absolute value of a number is the number without its sign.

Syntax

<number>.abs()

(or)

abs(<number>);   // This format is supported only in free-flow scripting mode of script builder.

The abs function syntax has the following arguments:

Number - Required. The real number (integer/decimal) of which you want the absolute value.

Return Value

Returns the absolute value of a number.

Example

abs(2) // returns 2
abs(-2) // returns 2

(or)

2.abs() // returns 2
-2.abs() // returns 2

Top