//方法一
public static String doubleTrans1(double num)
{
if(num % 1.0 == 0)
{
return String.valueOf((long)num);
}
return String.valueOf(num);
}
//方法二
public static String doubleTrans2(double num)
{
if(Math.round(num)-num==0)
{
return String.valueOf((long)num);
}
return String.valueOf(num);
}