四舍五入

///四舍五入
public
double transmitNum(double f) { if((f-(int)f)<=0.5&&(f-(int)f>0)) return (int)f+0.5; if((f-(int)f)>0.5) return (int)f+1.0; if((f-(int)f)==0) return f; return f; }

 

posted @ 2013-04-19 14:19  jeffrey77  阅读(124)  评论(0编辑  收藏  举报