资源介绍
十进制小数转化为十六进制小数类
///
/// 十进制整数转化为十六进制(带小数)
///
///
///
public string DecToHex(double value)
{
string result = "";
long zsHex = (long)value;
double xsHex = value - zsHex;
if (value < 0)
{
zsHex = -zsHex;
xsHex = -xsHex;
}
result = DecToHex(zsHex);
if (xsHex>ZERO)
{
result += "." +Hex(xsBinary(xsHex));
}
strB.Remove(0, strB.Length);
if (value < 0)
{
result += "-";
}
return result;
}
- 上一篇: C#入门经典第三版
- 下一篇: C#十六进制显示控件