A
Adrian
I guess it should be a piece of cake,
how do you convert an int to a hex value?
Thanks,
Adrian
how do you convert an int to a hex value?
Thanks,
Adrian
Adrian said:I guess it should be a piece of cake,
how do you convert an int to a hex value?
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
Adrian said:I guess it should be a piece of cake,
how do you convert an int to a hex value?
Thanks,
Adrian
This is more complicated than what HansMark Rae said:int intDec = 255;
string strHex = String.Format("{0:x2}",
(uint)System.Convert.ToUInt32(intDec));