roundToNearest()

概要

I の最も近い増分に number n round ()を使用して四捨五入します。 指定された number 2 つの増分は、最も近い偶数の増分に丸めの関数が等距離になります。

構文

roundToNearest ( n As Number, _
                 i As Number ) As Number 
引数 [タイプ] 説明
n Number は、入力 number です。
i Number 概数で表すための増分です。

例 1

Intent >roundToNearest(5.73, 0.25) 
--> 5.75 

例 2

Intent >roundToNearest(-0.37, 0.1) 
--> -0.4 

例 3

Intent >roundToNearest(376.9, 10) 
--> 380.0 

例 4

Intent >roundToNearest(385, 10) 
--> 380.0 
390.0 を返す roundInc (385, 10)と比較します