VBScript HexFunction
Complete VBScript Reference
The Hex function returns a string representing the hexadecimal value of a specified number.
Note:If the argument is not an integer, it is rounded to the nearest integer before the operation is performed.
Syntax
Hex(number)
| Parameter | Description |
|---|---|
| number | Required. Any valid expression. If number is:
|
Example
Example
<script type="text/vbscript">
document.write(Hex(3) & "<br />")
document.write(Hex(5) & "<br />")
document.write(Hex(9) & "<br />")
document.write(Hex(10) & "<br />")
document.write(Hex(11) & "<br />")
document.write(Hex(12) & "<br />")
document.write(Hex(400) & "<br />")
document.write(Hex(459) & "<br />")
document.write(Hex(460) & "<br />")
</script>
document.write(Hex(3) & "<br />")
document.write(Hex(5) & "<br />")
document.write(Hex(9) & "<br />")
document.write(Hex(10) & "<br />")
document.write(Hex(11) & "<br />")
document.write(Hex(12) & "<br />")
document.write(Hex(400) & "<br />")
document.write(Hex(459) & "<br />")
document.write(Hex(460) & "<br />")
</script>
The output result of the above example is:
3
5
9
A
B
C
190
1CB
1CC
5
9
A
B
C
190
1CB
1CC
Try it Yourself »
Complete VBScript Reference Other Extensions