A Adrian Oct 5, 2004 #1 I guess it should be a piece of cake, how do you convert an int to a hex value? Thanks, Adrian
H Hans Kesting Oct 5, 2004 #2 Adrian said: I guess it should be a piece of cake, how do you convert an int to a hex value? Thanks, Adrian Click to expand... int i=10; string s = i.ToString("x"); // "a" s = i.ToString("X"); // "A" s = i.ToString("X2"); // "0A" s = i.ToString("X4"); // "0000A" Hans Kesting
Adrian said: I guess it should be a piece of cake, how do you convert an int to a hex value? Thanks, Adrian Click to expand... int i=10; string s = i.ToString("x"); // "a" s = i.ToString("X"); // "A" s = i.ToString("X2"); // "0A" s = i.ToString("X4"); // "0000A" Hans Kesting
A Adrian Oct 5, 2004 #3 Great, thanks. Adrian Hans Kesting said: int i=10; string s = i.ToString("x"); // "a" s = i.ToString("X"); // "A" s = i.ToString("X2"); // "0A" s = i.ToString("X4"); // "0000A" Hans Kesting Click to expand...
Great, thanks. Adrian Hans Kesting said: int i=10; string s = i.ToString("x"); // "a" s = i.ToString("X"); // "A" s = i.ToString("X2"); // "0A" s = i.ToString("X4"); // "0000A" Hans Kesting Click to expand...
M Mark Rae Oct 5, 2004 #4 Adrian said: I guess it should be a piece of cake, how do you convert an int to a hex value? Thanks, Adrian Click to expand... int intDec = 255; string strHex = String.Format("{0:x2}", (uint)System.Convert.ToUInt32(intDec));
Adrian said: I guess it should be a piece of cake, how do you convert an int to a hex value? Thanks, Adrian Click to expand... int intDec = 255; string strHex = String.Format("{0:x2}", (uint)System.Convert.ToUInt32(intDec));
A Adrian Oct 5, 2004 #5 Mark Rae said: int intDec = 255; string strHex = String.Format("{0:x2}", (uint)System.Convert.ToUInt32(intDec)); Click to expand... This is more complicated than what Hans suggested, wouldn't you agree?
Mark Rae said: int intDec = 255; string strHex = String.Format("{0:x2}", (uint)System.Convert.ToUInt32(intDec)); Click to expand... This is more complicated than what Hans suggested, wouldn't you agree?