round

Function round 

Source
pub fn round(args: &[Value]) -> Result<Value, RuntimeError>
Expand description

四舍五入

§功能

将数字四舍五入到最接近的整数。

§参数

  • x: Number - 输入数字

§返回值

Number - 四舍五入后的整数值

§规则

  • 0.5 向上取整(远离零)

§示例

Set a Round(3.4)        # 3.0
Set b Round(3.5)        # 4.0
Set c Round(-2.5)       # -3.0