I の最も近い増分に number n round ()を使用して四捨五入します。 指定された number 2 つの増分は、最も近い偶数の増分に丸めの関数が等距離になります。
roundToNearest ( n As Number, _
i As Number ) As Number
引数 | [タイプ] | 説明 |
---|---|---|
n | Number | は、入力 number です。 |
i | Number | 概数で表すための増分です。 |
Intent >roundToNearest(5.73, 0.25)
--> 5.75
Intent >roundToNearest(-0.37, 0.1)
--> -0.4
Intent >roundToNearest(376.9, 10)
--> 380.0
Intent >roundToNearest(385, 10)
--> 380.0
390.0 を返す roundInc (385, 10)と比較します