功能简述
double number; //将要被转换的数
int ary; //目标进制
int accuracy; //指定小数保留的位数
特性
pulic class DanoR_Gist001
public static String HexConvert(double number, int ary, int accuracy)
{
int z = (int)number;
double x = number - z;
String r = "";
for(;z>0;z/=ary)
r = (char)(z%ary>9?z%ary+55:z%ary+48)+r;
if(x != 0.0)
r += '.';
for(int i=0;i<accuracy&&x!=0.0;i++)
{
r += (char)((x*=ary)>9?x+55:x+48);
x -= (int)x;
}
return r;
}
}