User Tools

Site Tools


syntax:functions:round

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
syntax:functions:round [2016/07/09 08:44] dmitrysyntax:functions:round [2021/07/31 21:49] craigt
Line 1: Line 1:
-===== Round(number, N) =====+====== Round(number, dec_places) =====
 +Category:  Number function
  
-Rounds a number to decimal digits. +\\  
 +=====Description===== 
 +This function rounds a number to //dec_places// number of decimal digits. 
  
-Note: there exist two types of rounding in general -- "Rounding away from zero" (a.k.a symmetric roundingand "Rounding to the nearest even number" (a.k.a. banker's rounding). This function is using the latter, as it's the standard way of rounding as described in IEEE Standard 754, section 4. For Excel-type rounding (away from zero) use [syntax:functions:roundxl] function.+\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|number|Number|The value, usually fractional, to be rounded.| 
 +|dec_places|Number (positive, >=0)|The number of decimal places to round //number// to.
 +\\  
 +**Return value type:**  Number
  
-^  Example  ^  Result  ^ +\\  
-| round5.55, 1 )  |  5.6 | +=====Remarks===== 
-| round5.65  5.6 |+There exist two types of rounding in general - "Rounding away from zero" (a.k.a symmetric rounding) and "Rounding to the nearest even number" (a.k.a. banker's rounding). This function is using the latteras it's the standard way of rounding as described in IEEE Standard 754, section 4. For Excel-type rounding (away from zerouse [[[syntax:functions:roundxl|RoundXL(number, dec_places)]] function.
  
 +Using a //dec_places// value of "0" rounds to the nearest whole number.
  
-=== See also === +\\  
-  * [[syntax:functions:floor]] +=====Examples===== 
-  * [[syntax:functions:ceiling]] + 
-  * [[syntax:functions:roundxl]]+  round(5.55, 1) = 5.6 
 +  round(5.65, 1) = 5.6 
 +  round(101.567, 2) = 101.57 
 +  round(101.5784, 3) = 101.578 
 +  round(92.523, 0) = 93 
 + 
 +\\  
 +===== See also ===== 
 +  * [[syntax:functions:ceiling|Ceiling(number)]] 
 +  * [[syntax:functions:floor|Floor(number)]] 
 +  * [[syntax:functions:roundxl|RoundXL(number, dec_places)]] 
 +  * [[syntax:functions:truncate|Truncate(number)]]
syntax/functions/round.txt · Last modified: 2023/02/28 20:13 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki