Developer Documentation Library > UNICOM Intelligence Function Library > Mathematical functions > Abs
 
Abs
Returns the absolute value of a number.
Syntax
Abs(<value>)
Parameters
<value>
Type: Double
A numeric value.
(return)
Type: Double
<value> with any negative sign removed.
Notes
If <value> is negative, the return value is -<value>, otherwise the return value is <value>. If the current data value is NULL, <value> is 0.0 and the return value is 0.0.
This function is similar to the Abs function in VBScript.
Example
The following mrScriptBasic example uses the Abs function to get the absolute value of two numbers:
Dim MyPositiveNumber, MyNegativeNumber
MyPositiveNumber = Abs(150) ' Returns 150
MyNegativeNumber = Abs(-150) ' Returns 150
See also
Sgn
Mathematical functions