Sign Function

Returns the sign of the number passed to it.

Syntax
result = Sign( value )

Parameters
value | Double | The number being passed to the function.

Return Value
Result | Integer | The sign of value. Returns- 1 if value is negative, 0 if value is zero, and 1 if value is positive. If you pass a String or some other incorrect data type, result is 0.

# Example

The following example determines the sign of the number passed to it.

Dim d as Double
Dim result as Integer
If EditField1.text <>"" then
result=Sign( Val(EditField1.text))
MsgBox Str(result)
Else
MsgBox "Please enter a number!"
End if

# See Also

Abs, Val functions.