Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript Sgn function


May 13, 2021 VBScript


Table of contents


VBScript Sgn function

The VBScript Sgn function returns an integer of a symbol that represents a number.


VBScript Sgn function Complete VBScript reference manual

The Sgn function returns an integer that indicates the symbol of the specified number.

Grammar

Sgn(number)

Parameters

parameter describe
number Required.Effective numerical expression.

If the number is:

  • > 0 - SGN will return 1
  • = 0 - SGN will return 0
  • <0 - SGN will return -1
<script type="text/vbscript">

document.write(Sgn(15) & "<br />")
document.write(Sgn(-5.67) & "<br />")
document.write(Sgn(0))

</script>

The above example output results:

1
-1
0

Try it out . . .

VBScript Sgn function Complete VBScript reference manual