VBScript » Functions » Sgn

Syntax:
Sgn(Number)

The Sgn function returns the sign of a number.

Examples

Code:
<% =Sgn(-127.89) %>
Output:
-1
Explanation:

-1 indicates a negative number.

Language(s): VBScript
Code:
<% =Sgn(0) %>
Output:
0
Explanation:

0 indicates the number zero.

Language(s): VBScript
Code:
<% =Sgn(127.89) %>
Output:
1
Explanation:

1 indicates a positive number.

Language(s): VBScript

See Also: