Question[Help]Convert decimal to Hex[Solved]

Posts 1–4 of 4 · Page 1 of 1
[Help]Convert decimal to Hex[Solved]
What is the function to convert decimal to hex?
Numerous

Note: wherever it says FromBase you can actually set the base
Example: 16,32,8,etc.

or just leave it as frombase

[php]
Convert a binary, octal, hexadecimal value to decimal


Dim byteC As Byte = Convert.ToByte(value, fromBase)
Dim ShortC As Short = Convert.ToInt16(value, fromBase)
Dim IntegerC As Integer = Convert.ToInt32(value, fromBase)
Dim longC As Long = Convert.ToInt64(value, fromBase)
[/php]

or

[php]
Dim dec As Integer = "Integer Value"
Dim hex As String = dec.ToString("X")
Dim decAgain As Integer = Integer.Parse(hex, System.Globalization.NumberStyles.HexNumber)
[/php]

[php]
Textbox1.text =Conversion.Hex(integer)
[/php]

[php]
Msgbox(Conversion.Hex(integer))
[/php]

[php]
Dim Val As Integer
Val = Convert.ToInt32("To Convert here", FromBase)
[/php]

16 being the base integer.
You can change that.

[php]
Dim s as string = "FF"
Dim value as Integer

value = val( "&h" & s )
[/php]

[php]
label1.text =Conversion.Hex(integer)
[/php]

or whatever

the values arent correct.

here is a list

Decimal:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Hex:
0 1 2 3 4 5 6 7 8 9 A B C D E F

so 10 = A
11 = B...

nvm found it

MsgBox(Conversion.Hex(integer))
Solved then
Posts 1–4 of 4 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us