使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
math.round
math.round(numericExpression, decimalPlaces)
说明
返回舍入到最接近的整数或指定小数位数的值。
参数数据类型
NUMBER
返回类型
NUMBER
代码示例
math.round(10.7) // returns 11
math.round(1.2567, 2) // returns 1.25
math.round(0-10.7) // returns -11
math.round(0-1.2) // returns -1
math.round(4) // returns 4, math.round(integer) returns the integer
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-30。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-01-30。"],[[["`math.round` function rounds a numeric value to the nearest integer or a specified number of decimal places."],["The function supports `NUMBER` as the input data type and returns a `NUMBER` type value."],["If no decimal places are specified, the function rounds to the nearest whole number."],["Negative values can be used and will be rounded accordingly to the nearest negative whole number or to the specified negative decimal place."],["The function is available within the context of `Search` as described in the documentation."]]],[]]