Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

This is done using the String.Format method.  You can use both positive or negative decimal values (that must of course be integers) eg:

int decimalValue = -12345;
Console.WriteLine (String.Format("{0:x2}", decimalValue));

HTH
Tim

Posted on Tuesday, April 11, 2006 11:33 AM C# .NET , ASP.NET | Back to top


Comments on this post: Converting an integer to hexidecimal using C#.Net

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net