VBScript Round 函数
定义和用法
Round 函数可对数字进行四舍五入。
语法
Round(expression[,numdecimalplaces])
参数 | 描述 |
---|---|
expression | 必需的。需要被四舍五入的表达式。 |
numdecimalplaces | 可选的。规定对小数点右边的多少位进行四舍五入。默认是 0。 |
本在线速查手册由www.w▤▥▦3▤▥▦x▤▥▦u▤▥▦e.com提供,请勿盗用!
实例
例子 1
dim x x=24.13278 document.write(Round(x))
输出:
24
例子 2
dim x x=24.13278 document.write(Round(x,2))
输出:
24.13