Difference between revisions of "Manuals/calci/MROUND"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="16SpaceContent" align="left"><div class="ZEditBox" align="justify"> Syntax </div></div> ---- <div id="4SpaceContent" align="left"><div class="ZEditBox" align=...")
 
Line 1: Line 1:
<div id="16SpaceContent" align="left"><div class="ZEditBox" align="justify">
+
=MROUND(number, multiple)=
  
Syntax
+
*Where 'number' is the number to round and
 +
*'multiple' is the number of digits to which the number is to be rounded.
  
</div></div>
+
ROUND() rounds a number to specified number of digits.
----
 
<div id="4SpaceContent" align="left"><div class="ZEditBox" align="justify">
 
  
Remarks
+
== Description ==
  
</div></div>
+
MROUND(number, multiple)
----
 
<div id="2SpaceContent" align="left"><div class="ZEditBox" align="justify">
 
  
Examples
+
This function is used to round a number to certain number of digits mentioned in the argument.
  
</div></div>
+
For Example,
----
 
<div id="8SpaceContent" align="left"><div class="ZEditBox" align="justify">'''<font face="Times New Roman">''''''''''''<font size="6"> </font>''' '''''''''</font>'''</div></div>
 
----
 
<div id="11SpaceContent" align="left"><div class="ZEditBox mceEditable" align="justify">
 
  
<font size="5">Description</font>
+
MROUND(3.6712,2) ''returns 3.67'' as a result.
  
</div></div>
+
MROUND(411.3,-1) ''returns 410'' as a result.
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">'''<font face="Times New Roman"> <font size="6">MROUND</font> </font>'''</div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><br /><div id="7Space" class="gamizbox" title="7Space"><div id="7SpaceHeader" class="zheaderstyle" title="Double-click to start and stop editing the header."><center></center></div><div id="7SpaceRollup" title="Double-click to rolldown" align="left"><span><span id="7SpaceRollupContent" align="center"></span></span></div><div id="7SpaceCover"><div id="7SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify"><font size="3" face="Times New Roman"> </font>
 
  
'''MROUND''' ('''N''',''' M''')
+
*If 'num_of_digits' is omitted, Calci assumes it to be zero and rounds the number to the nearest integer.
 +
*The number is rounded to the specified number of decimal places, if num_of_digits > 0.
 +
*The number is rounded to the nearest integer, if num_of_digits = 0.
 +
*The number is rounded to the left of the decimal point, if num_of_digits < 0.
 +
*If any argument is non-numeric, Calci displays #NaN error message.
  
''' Where N''' is the number to round and '''M''' is the multiple.
+
MROUND() can also be used for multiple number array as -
  
</div></div>
+
MROUND(2.5..6..0.5) that rounds the numbers 2.5 to 6 in steps of 0.5.
----
 
<div id="13SpaceContent" class="zcontent" align="left"><br /><br /><div id="1Space" class="gamizbox" title="1Space"><div id="1SpaceHeader" class="zheaderstyle" title="Double-click to start and stop editing the header."><center></center></div><div id="1SpaceRollup" title="Double-click to rolldown" align="left"><span><span id="1SpaceRollupContent" align="center"></span></span></div><div id="1SpaceCover"><div id="1SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify"><font size="3"><font face="Times New Roman"> 
 
  
* <font size="3">MROUND displays zero if N and M have two different signs.</font>
+
{| class="wikitable"
 
+
|-
</font>
+
! Number !! MROUND
 
+
|-
<font face="Times New Roman"> </font>
+
| 2.5 || 3
 
+
|-
</font></div></div>
+
| 3 || 3
----
+
|-
<div id="14SpaceContent" class="zcontent" align="left"><br /><br /><br /><div id="5Space" class="gamizbox" title="5Space"><div id="5SpaceHeader" class="zheaderstyle" title="Double-click to start and stop editing the header."><center></center></div><div id="5SpaceRollup" title="Double-click to rolldown" align="left"><span><span id="5SpaceRollupContent" align="center"></span></span></div><div id="5SpaceCover"><div id="5SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">It calculates a number rounded to the desired multiple.</div></div>
+
| 3.5 || 4
----
+
|-
<div id="12SpaceContent" class="zcontent" align="left"><br /><br /><br /><div id="9Space" class="gamizbox" title="9Space"><div id="9SpaceHeader" class="zheaderstyle" title="Double-click to start and stop editing the header."><center></center></div><div id="9SpaceRollup" title="Double-click to rolldown" align="left"><span><span id="9SpaceRollupContent" align="center"></span></span></div><div id="9SpaceCover"><div id="9SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify"><font size="3"><font face="Times New Roman"> 
+
| 4 || 4
 +
|-
 +
| 4.5 || 5
 +
|-
 +
| 5 || 5
 +
|-
 +
| 5.5 || 6
 +
|-
 +
| 6 || 6
 +
|-
 +
|}
  
Lets see an example in (Column1 Row 1, Column2Row1)
+
*ROUNDUP() can be used to round a number away from zero.
 +
*ROUNDDOWN() can be used to round a number towards zero.
 +
*MROUND() can be used to round a number to desired multiple.
  
MROUND (N, M)
+
== Examples ==
  
MROUND (C1R1, C2R1)
 
 
i.e. =MROUND (7, 3) is 6
 
 
</font></font></div></div>
 
----
 
 
<div id="6SpaceContent" class="zcontent" align="left">
 
<div id="6SpaceContent" class="zcontent" align="left">
  
 
{| id="TABLE3" class="SpreadSheet blue"
 
{| id="TABLE3" class="SpreadSheet blue"
 
|- class="even"
 
|- class="even"
| class="  " |
+
| class="  " | '''Function'''
<div id="6Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
+
| class="  " | '''Output'''
| Column1
+
 
| class="  " | Column2
 
| class="  " | Column3
 
| class="  " | Column4
 
 
|- class="odd"
 
|- class="odd"
| class=" " | Row1
+
| class="sshl_f" | MROUND(3.6712,2)
| class="sshl_f" | 7
+
| class="sshl_f" | 3.67
| class="sshl_f" | 3
+
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|- class="even"
 
|- class="even"
| class="  " | Row2
+
| class="sshl_f" | MROUND(99.37,0)
| class="sshl_f" | 6
+
| class="sshl_f" | 99
| class="sshl_f" |
+
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|- class="odd"
 
|- class="odd"
| Row3
+
| class="sshl_f" | MROUND(99.37)
| class="sshl_f SelectTD SelectTD" |
+
| class="sshl_f" | 99
<div id="6Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="6Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
+
 
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|- class="even"
 
|- class="even"
| Row4
+
| class="sshl_f" | MROUND(145.8,-1)
| class="sshl_f" |
+
| class="sshl_f" | 150
| class="sshl_f" |
+
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|- class="odd"
 
|- class="odd"
| class=" " | Row5
+
| class="sshl_f" | MROUND(-89.65,1)
| class="sshl_f" |
+
| class="sshl_f" | -89.7
| class="sshl_f" |
+
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|- class="even"
 
|- class="even"
| Row6
+
| class="sshl_f" | MROUND(-89.65,-1)
| class="sshl_f" |
+
| class="sshl_f" | -90
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|}
 
|}
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
== See Also ==
----
+
 
</div></div></div></div></div></div></div></div></div></div></div></div>
+
*[[Manuals/calci/ROUND | ROUND]]
 +
 
 +
*[[Manuals/calci/ROUNDDOWN | ROUNDDOWN]]
 +
 
 +
*[[Manuals/calci/ROUNDUP | ROUNDUP]]
 +
 
 +
*[[Manuals/calci/INT | INT]]
 +
 
 +
*[[Manuals/calci/TRUNC | TRUNC]]
 +
 
 +
*[[Manuals/calci/CEILING | CEILING]]
 +
 
 +
*[[Manuals/calci/FLOOR | FLOOR]]
 +
 
 +
==References==
 +
 
 +
*[http://en.wikipedia.org/wiki/Rounding Round Function]

Revision as of 15:35, 3 December 2013

MROUND(number, multiple)

  • Where 'number' is the number to round and
  • 'multiple' is the number of digits to which the number is to be rounded.

ROUND() rounds a number to specified number of digits.

Description

MROUND(number, multiple)

This function is used to round a number to certain number of digits mentioned in the argument.

For Example,

MROUND(3.6712,2) returns 3.67 as a result.

MROUND(411.3,-1) returns 410 as a result.

  • If 'num_of_digits' is omitted, Calci assumes it to be zero and rounds the number to the nearest integer.
  • The number is rounded to the specified number of decimal places, if num_of_digits > 0.
  • The number is rounded to the nearest integer, if num_of_digits = 0.
  • The number is rounded to the left of the decimal point, if num_of_digits < 0.
  • If any argument is non-numeric, Calci displays #NaN error message.

MROUND() can also be used for multiple number array as -

MROUND(2.5..6..0.5) that rounds the numbers 2.5 to 6 in steps of 0.5.

Number MROUND
2.5 3
3 3
3.5 4
4 4
4.5 5
5 5
5.5 6
6 6
  • ROUNDUP() can be used to round a number away from zero.
  • ROUNDDOWN() can be used to round a number towards zero.
  • MROUND() can be used to round a number to desired multiple.

Examples

Function Output
MROUND(3.6712,2) 3.67
MROUND(99.37,0) 99
MROUND(99.37) 99
MROUND(145.8,-1) 150
MROUND(-89.65,1) -89.7
MROUND(-89.65,-1) -90

See Also

References