数据处理

四舍五入

int(x/y+0.5);

保留a位小数

int a;
(int)(x*pow(a)+0.5)/(double)pow(a)

 

posted @ 2019-06-28 11:42  HHHG  阅读(162)  评论(0编辑  收藏  举报