数据处理

四舍五入

int(x/y+0.5);

保留a位小数

int a;
(int)(x*pow(a)+0.5)/(double)pow(a)
原文地址:https://www.cnblogs.com/HHHG/p/11101826.html