# EasyMorph Help

### Site Tools

syntax:functions:roundxl

# Differences

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

 syntax:functions:roundxl [2021/09/07 11:20]craigt [See also] syntax:functions:roundxl [2021/09/30 13:10] (current)dmitry Both sides previous revision Previous revision 2021/09/30 13:10 dmitry 2021/09/07 11:20 craigt [See also] 2021/08/11 15:34 craigt [Examples] 2021/07/31 21:40 craigt 2016/08/23 18:09 dmitry 2016/08/13 11:25 dmitry 2016/07/09 08:48 dmitry created 2021/09/30 13:10 dmitry 2021/09/07 11:20 craigt [See also] 2021/08/11 15:34 craigt [Examples] 2021/07/31 21:40 craigt 2016/08/23 18:09 dmitry 2016/08/13 11:25 dmitry 2016/07/09 08:48 dmitry created Line 7: Line 7: Excel rounding logic rounds a decimal value of 5 or greater //up// to the next nearest value (towards positive infinity) and 4 or less //down// to the next nearest value (towards negative infinity). Excel rounding logic rounds a decimal value of 5 or greater //up// to the next nearest value (towards positive infinity) and 4 or less //down// to the next nearest value (towards negative infinity). + + \\ + + =====Alternative syntax===== + The 2nd argument in this function is optional. If omitted, it's assumed to be 0. + RoundXL(number)  //The same as RoundXL(number, 0) \\ \\ Line 12: Line 18: ^Argument^Type^Description^ ^Argument^Type^Description^ |number|Number|The value, usually fractional, to be rounded.| |number|Number|The value, usually fractional, to be rounded.| - |dec_places|Number (positive, >=0)|The number of decimal places to round //number// to.| + |dec_places|Number (from -9 to 28)|The number of decimal places to round //number// to.| \\ \\ **Return value type:**  Number **Return value type:**  Number Line 18: Line 24: \\ \\ =====Remarks===== =====Remarks===== - There exists 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 uses the former (symmetric rounding), which is also the type of rounding used in Excel.  For standard rounding (banker's rounding) use [[syntax:functions:round|Round(number, dec_places)]]. + 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 uses the former (symmetric rounding), which is also the type of rounding used in Excel.  For standard rounding (banker's rounding) use [[syntax:functions:round|Round(number, dec_places)]]. Using a //dec_places// value of "0" rounds to the nearest whole number. Using a //dec_places// value of "0" rounds to the nearest whole number. Line 33: Line 39: roundxl(20.5456, 3) //Returns 20.546 roundxl(20.5456, 3) //Returns 20.546 + roundxl(12345, -2) //Returns 12300 \\ \\ 