CitectVBA Programming Reference > CitectVBA Function Reference > Conversion Functions > Hex

Hex

Converts a numeric value to a text string representing the hexadecimal value of the number.

The Hex function expects the argument Num to be a valid numeric value. It is rounded to nearest whole number before evaluation.

Syntax

Hex(Num)

Num:

An Integer or expression representing a valid numeric value.

Return Value

Returns a text string containing the hexadecimal value of the numeric Num value provided in the argument.

Related Functions

Format | Oct | Str | Val

Example

Dim MyHex as String	
MyHex = Hex(5) 'returns "5"
MyHex = Hex(10) 'returns "A"
MyHex = Hex(459) 'returns "1CB"