# Problem : Convert Decimal to Hex

Page 1 of 1

## 1 Replies - 1599 Views - Last Post: 06 February 2013 - 09:33 PMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=311428&amp;s=8806a29b71dc5c641f495936ce50442d&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 little_prince41

Reputation: 3
• Posts: 152
• Joined: 10-August 07

# Problem : Convert Decimal to Hex

Posted 06 February 2013 - 06:46 PM

Hello!

I have a problem about convert decimal to hex format, I need to convert decimal to hex format 2 digit.
Exp. "1000"(dem) to "03 E8" , can someone help me.
Is This A Good Question/Topic? 0

## Replies To: Problem : Convert Decimal to Hex

### #2 lar3ry

• Coding Geezer

Reputation: 313
• Posts: 1,296
• Joined: 12-September 12

## Re: Problem : Convert Decimal to Hex

Posted 06 February 2013 - 09:33 PM

little_prince41, on 06 February 2013 - 07:46 PM, said:

I have a problem about convert decimal to hex format, I need to convert decimal to hex format 2 digit.
Exp. "1000"(dem) to "03 E8" , can someone help me.

Just a few examples. I'll leave it up to you to do the entire formatting in whatever way you want.
Dim value As Integer = 1000
Debug.Print(value.ToString("X"))
Debug.Print(value.ToString("X4"))
Debug.Print((value \ 256).ToString("X2"))
Debug.Print((value Mod 256).ToString("X2"))