十进制小数转化为十六进制小数
十进制小数转化为十六进制小数类 /// /// 十进制整数转化为十六进制(带小数) /// /// /// public string DecToHex(double value) { string result = ""; long zsHex = (long)value; double xsHex = value - zsHex; if (value < 0) { zsHex = -zsHex; xsHex = -xsHex; } result = DecT oHex(zsHex); if (xsHex>ZERO) { result += "." +Hex(xsBinary(xsHex)); } strB.Remove(0, strB.Length); if (value < 0) { result += "-"; } return result; }
用户评论