VBScript Hex function
Hex function returns a string representing the hexadecimal value of a specified number.
Note: If the parameter is not an integer, making it rounded to the nearest integer before the operation.
grammar
Hex(number)
参数 | 描述 |
---|---|
number | 必需。任何有效的表达式。 如果数字是:
|
Examples
Examples
<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>
Examples of the above output:
3
5
9
A
B
C
190
1CB
1CC
5
9
A
B
C
190
1CB
1CC
try it"
Complete VBScript Reference