Siebel VB Language Reference > Siebel VB Language Reference >

Abs Function


This standard VB function returns the absolute value of a number.

Syntax

Abs(number)

Argument
Description
number
Any valid numeric expression

Returns

The absolute value of number.

Usage

The data type of the return value matches the type of the number. If number is a variant string (vartype 8), the return value is converted to vartype 5 (double). If the absolute value evaluates to vartype 0 (Empty), the return value is vartype 3 (long).

Example

This example finds the difference between two variables, oldacct and newacct.

Sub Button_Click
Dim oldacct, newacct, count
   oldacct = 1234566
   newacct = 33345
   count = Abs(oldacct - newacct)
End Sub

See Also

Exp Function
Fix Function
Int Function
Log Function
Rnd Function
Sgn Function
Sqr Function


 Siebel VB Language Reference
 Published: 18 June 2003