string DecToHex(int value)
{
int Hexbit = 0;
char Hexbitstr = '\0';
string HexStr = "";
while (value)
{
Hexbit = value % 16;
if (Hexbit < 10)
{
Hexbitstr = Hexbit + '0';
}
else
{
Hexbitstr = Hexbit + 'A' - 10;
}
HexStr = Hexbitstr + HexStr;
value /= 16;
}
if (HexStr == "")
{
HexStr += '0';
}
return HexStr;
}