JavaScript Math round() 方法
round() — 把一个数字舍入为最接近的整数
JavaScript Math round() 方法语法
JavaScript Math round() 方法参数说明
x — 待处理的数字
JavaScript Math round() 方法返回值
与 x 最接近的整数
说明:
对于 0.5,该方法将进行上舍入。
( 例如,3.5 将舍入为 4,而 -3.5 将舍入为 -3。)
JavaScript Math round() 方法
round() — 把一个数字舍入为最接近的整数
x — 待处理的数字
与 x 最接近的整数
说明:
对于 0.5,该方法将进行上舍入。
( 例如,3.5 将舍入为 4,而 -3.5 将舍入为 -3。)