ABS

Returns the absolute value of the number passed to the function.

Syntax

= ABS(value)

Parameters

Value

A number whose absolute value is to be calculated.  The number can be specified as an integer (e.g., 37), a decimal value (e.g., 37.48), as a string, or as the value of a variable (e.g, UnitPrice).

Return Type

Decimal number.

In the case of an error, the function displays an error message: “ABS(value): Error message”

Examples

Example

Returns

= ABS(-3)

3

= ABS(3)

3

= ABS(“$1,234”)

1234

= ABS(“$-1,234.57”)

1234.57

= ABS(UnitPrice)

The absolute value of the UnitPrice variable

= ABS(“abcd”)

Displays message “ABS(abcd): Input string was not in a correct format.”

= POWER(UnitPrice, ABS(-2))

The square of the value of the UnitPrice variable

= MAX(UnitPrice, ABS(“$-12”))

The maximum of UnitPrice and the number 12.