Name

Hex Function — Microsoft.VisualBasic.Conversion

Synopsis

Hex(number)
number required; Numeric or String

A valid numeric or string expression

Return Value

String representing the hexadecimal value of number

Description

Converts a number to its hexadecimal (base 16) equivalent. If number contains a fractional part, it will be automatically rounded to the nearest whole number before the Hex function is evaluated. number must evaluate to a numeric expression that ranges from -2,147,483,648 to 2,147,483,647. If the argument is outside of this range, an exception results. The return value of Hex is dependent upon the value and type of number:

number

Return value

Nothing

Zero (0)

Any other number

Up to eight hexadecimal characters

Get VB.NET Language Pocket Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.