VBScript » Functions » Hex

Version: 1.0

Syntax:
Hex(Number)

The Hex function returns the hexadecimal value of an integer number.

Examples

Code:
<% =Hex(123) %>
Output:
7B
Language(s): VBScript
Code:
<% =Hex(-123) %>
Output:
FF85
Explanation:

You can also use a negative integer number.

Language(s): VBScript
Code:
<% =Hex(123.456) %>
Output:
7B
Explanation:

For a number with a decimal point (floating-point), the digits to the right of the decimal point are ignored.

Language(s): VBScript

See Also: