可以用一种笨方法实现
if(i.tostring().length==((int)i).tostring().length)
//整数
i=(int)i;
else
i=round(i,2);