PC Review


Reply
Thread Tools Rate Thread

How to convert dec to hex and binary

 
 
Soon Lee
Guest
Posts: n/a
 
      22nd Feb 2005
ANy one know of any fast method in converting dec to hex or bin?

--
WebSite : http://soonlee.agreatserver.com


 
Reply With Quote
 
 
 
 
Morten Wennevik
Guest
Posts: n/a
 
      22nd Feb 2005
Hi Soon Lee,

If you by dec mean base 10 numbers, then you can use
Convert.ToString(number, base).

int n = 15;
string s1 = Convert.ToString(n, 2); // == 1111
string s2 = Convert.ToString(n, 16); // == f


--
Happy Coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert Binary to Hex =?Utf-8?B?Q2hpcG11bms=?= Microsoft Excel Programming 9 24th Aug 2006 12:53 PM
How to convert all to binary? =?Utf-8?B?RGFuaWVs?= Microsoft ASP .NET 2 20th Oct 2005 04:38 PM
Convert file to binary, send it over the network, and convert it b =?Utf-8?B?Q2hld2ll?= Microsoft Dot NET 0 9th Sep 2005 06:04 PM
Convert file to binary, send it over the network, and convert it b =?Utf-8?B?Q2hld2ll?= Microsoft Dot NET Framework 1 9th Sep 2005 06:01 PM
Convert binary file->utf8->binary file Joey Lee Microsoft C# .NET 2 25th Apr 2005 07:16 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:34 PM.