Round函数

时间:2014-08-18 12:16:34   收藏:0   阅读:344

Round():函数返回一个数值,舍入到指定的长度或精度

eg:

--1)
   Round( 123.9994 , 3 )  ---->123.9990
   Round( 123.9995 , 3 )  ---->124.0000
   --3为需要舍入的位数

--2)
  Round( 123.45, -2 )     ----->100.00
  --如果为负数,舍入整数部分靠近小数点部分的

--3)截断
  Round( 150.75, 0 )      ----->舍入:151.00
  Round( 150.75, 0, 1)    ----->截断:150.00
                    1:默认的样式为0,如果是不为0以外的值,将会截断

 

Round函数,布布扣,bubuko.com

原文:http://www.cnblogs.com/dingqin0525/p/3919126.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!