Hex To Dec

J

Jeremy Cowles

Is there a function for converting Hex To Dec

Val will do it (just prefix with &h), and there may be others...

Dim s as string = "FF"
Dim value as Integer

value = val( "&h" & s )

HTH

~
Jeremy
 
J

Jay B. Harlow [MVP - Outlook]

Chris,
In addition to the Val function.

You can use System.Convert.ToInt32(string, integer)

Dim i As Integer
i = Convert.ToInt32("abcd", 16)

Where the integer parameter is the base, in this case 16.

Hope this helps
Jay
 
H

Herfried K. Wagner [MVP]

Hello,

Chris Wilmot said:
Is there a function for converting Hex To Dec

\\\
Dim s As String = "0A"
MsgBox(CInt("&H" & s))
MsgBox(Convert.ToInt32(s, 16))
///

HTH,
Herfried K. Wagner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top