Abs (open)
Returns the absolute value of a number
Syntax
// Core function, no LOADLIB necessary
VARIANT FUNCTION Abs(VARIANT value)
Parameters
VARIANT value
The value for which the absolute value should be returned
Return value
VARIANT
Absolute value of the value. The type of the returned number is the same as the type of the parameter.
Description
This function returns the absolute value of a number. A number can be of the type INTEGER, MONEY or FLOAT. A runtime-error is generated if a non-number is passed to this function.
Examples
// returns 6
INTEGER example1 := Abs(-6);
// returns 4.4m
MONEY example1 := Abs(-4.4m);
// returns 5.36 (as a Float)
FLOAT example1 := Abs(5.36f);