假如a是那个需要保留到小数点后一位的浮点数 比如double a=10.67; 对a进行如下操作 a*10+0.5 =107.2 int(a*10+0.5)=107 doubel a=int(a*10+0.5)/10; a=10.7 保留到小数点的后其他几位也可以采用同样的方法