hexadecimal convertions

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2007
Posts: 266
Reputation: quintoncoert is an unknown quantity at this point 
Solved Threads: 3
quintoncoert quintoncoert is offline Offline
Posting Whiz in Training

hexadecimal convertions

 
0
  #1
Jul 17th, 2007
hi. can anyone tell me if there is any build-in functions which converts hexadecimal to decimal and decimal to hexadecimal in C#?
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 322
Reputation: Hamrick will become famous soon enough Hamrick will become famous soon enough 
Solved Threads: 33
Hamrick's Avatar
Hamrick Hamrick is offline Offline
Posting Whiz

Re: hexadecimal convertions

 
0
  #2
Jul 17th, 2007
System.String.Format lets you do that with the D and X formatters.
  1. string decString = string.Format( "{0:D}", decValue );
  2. string hexString = string.Format( "{0:X}", hexValue );
You can also just print the formatted values with Write or WriteLine because they use the same formatter strings.
The truth does not change according to our ability to stomach it.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC