User Tools

Site Tools


syntax:functions:mround

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
syntax:functions:mround [2021/09/07 11:19] – created craigtsyntax:functions:mround [2021/09/07 11:50] – [Examples] craigt
Line 16: Line 16:
 \\  \\ 
 =====Remarks===== =====Remarks=====
-MRound rounds a grain value of 5 and less down, and greater than 5, up.  See Examples below.+MRound uses "bankers rounding" which rounds to the nearest //even// value.
  
  
Line 24: Line 24:
   mround(5.3, 0.5) //Returns 5.5   mround(5.3, 0.5) //Returns 5.5
  
-  mround(10.05, 0.1) //Returns 10.0 (.05 rounds down)+  mround(10.05, 0.1) //Returns 10.0 (bankers rounding rounds to the closest even value)
  
-  mround(10.06, 0.1) //Returns 10.(greater than .05 rounds up)+  mround(10.15, 0.1) //Returns 10.(bankers rounding rounds to the closest even value)
  
   mround(20.78, 1) //Returns 21   mround(20.78, 1) //Returns 21
syntax/functions/mround.txt · Last modified: 2022/11/06 17:10 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki