vc 将数据四舍五入的方法

来源:互联网 发布:mac如何在pdf上签名 编辑:程序博客网 时间:2024/06/05 05:55
 int b=0;
if(Date<0)//负数情况下
{b = int((Date-0.0005)*1000) ; }//将数据四舍五入
else//正数情况下
{ b = int((Date+0.0005)*1000) ;}//将数据四舍五入  
Date =  b/1000.0;
return Date;