コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
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 Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-02-13 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-02-13 UTC。"],[[["`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."]]],[]]