Function Abs() Foundation
Determines the absolute value of a numeric expression.
Abs( <nExpression> ) --> nPositive
The return value of Abs() is a number >= 0 which represents the absolute value of <nExpression>.
The numeric function Abs() always returns a numeric value as a positive number regardless of its sign.
// The example shows results of the function Abs()
PROCEDURE Main
nValue1 := 200
nValue2 := 500
? nValue1 - nValue2 // result: -300
? Abs( nValue1 - nValue2 ) // result: 300
? Abs( nValue2 - nValue1 ) // result: 300
? Abs( -500 ) // result: 500
? Abs( 0 ) // result: 0
RETURN
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.