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=...")
 
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div id="16SpaceContent" align="left"><div class="ZEditBox" align="justify">
+
<div style="font-size:30px">'''MROUND (Number,Multiple)'''</div><br/>
 +
*Where 'Number' is the number to round and
 +
*'Multiple' is the multiple value to which number is to be rounded.
 +
**MROUND() returns a number rounded to the desired multiple
  
Syntax
+
== Description ==
  
</div></div>
+
MROUND(Number, Multiple)
----
 
<div id="4SpaceContent" align="left"><div class="ZEditBox" align="justify">
 
  
Remarks
+
This function is used to round a number up or down depending on the multiple value.
  
</div></div>
+
For Example,
----
 
<div id="2SpaceContent" align="left"><div class="ZEditBox" align="justify">
 
  
Examples
+
MROUND(3.6, 2) ''returns 4'' as a result.
  
</div></div>
+
MROUND(44.1, 4) ''returns 44'' as a result.
----
 
<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>
+
*The number is rounded up or down, depending on the remainder of division of the number and the multiple. If the remainder is more than or equal to half the multiple value, the number is rounded up, else it is rounded down towards zero.
 +
*Calci returns an NaN error message if any argument is nonnumeric or omitted.
 +
*Calci returns an #ERROR message if 'number' and 'multiple' have different signs.
 +
*If the number is an exact multiple, rounding will not be done. Calci will display the same number as output.
  
</div></div>
+
MROUND() can also be used for multiple number array as -
----
 
<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''')
+
MROUND(2.5..7.5, 2) that rounds the numbers from 2.5 to 7.5 to nearest multiple of 2.
  
''' Where N''' is the number to round and '''M''' is the multiple.
+
{| class="wikitable"
 
+
|-
</div></div>
+
! Number !! Multiple !! MROUND
----
+
|-
<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"> 
+
| 2.5 || 2 || 2
 
+
|-
* <font size="3">MROUND displays zero if N and M have two different signs.</font>
+
| 3.5 || 2 || 4
 
+
|-
</font>
+
| 4.5 || 2 || 4
 
+
|-
<font face="Times New Roman"> </font>
+
| 5.5 || 2 || 6
 
+
|-
</font></div></div>
+
| 6.5 || 2 || 6
----
+
|-
<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>
+
| 7.5 || 2 || 8
----
+
|-
<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"> 
+
|}
 
 
Lets see an example in (Column1 Row 1, Column2Row1)
 
  
MROUND (N, M)
+
*ROUND() can be used to round a number to specified number of digits.
 +
*ROUNDUP() can be used to round a number away from zero.
 +
*ROUNDDOWN() can be used to round a number towards zero.
  
MROUND (C1R1, C2R1)
+
== Examples ==
  
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.67,2)
| class="sshl_f" | 7
+
| class="sshl_f" | 4
| class="sshl_f" | 3
+
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|- class="even"
 
|- class="even"
| class="  " | Row2
+
| class="sshl_f" | MROUND(99,3)
| 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(4.35,0.01)
| class="sshl_f SelectTD SelectTD" |
+
| class="sshl_f" | 4.35
<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(-89.65,-3)
| class="sshl_f" |
+
| class="sshl_f" | -90
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
|- class="odd"
 
| class=" " | Row5
 
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
|- class="even"
 
| Row6
 
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
| class="sshl_f" |
 
 
|}
 
|}
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
==Related Videos==
----
+
 
</div></div></div></div></div></div></div></div></div></div></div></div>
+
{{#ev:youtube|dyMgvQLTzVE|280|center|MROUND}}
 +
 
 +
== See Also ==
 +
 
 +
*[[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]
 +
 
 +
 
 +
 
 +
*[[Z_API_Functions | List of Main Z Functions]]
 +
 
 +
*[[ Z3 |  Z3 home ]]

Latest revision as of 14:56, 21 August 2018

MROUND (Number,Multiple)


  • Where 'Number' is the number to round and
  • 'Multiple' is the multiple value to which number is to be rounded.
    • MROUND() returns a number rounded to the desired multiple

Description

MROUND(Number, Multiple)

This function is used to round a number up or down depending on the multiple value.

For Example,

MROUND(3.6, 2) returns 4 as a result.

MROUND(44.1, 4) returns 44 as a result.

  • The number is rounded up or down, depending on the remainder of division of the number and the multiple. If the remainder is more than or equal to half the multiple value, the number is rounded up, else it is rounded down towards zero.
  • Calci returns an NaN error message if any argument is nonnumeric or omitted.
  • Calci returns an #ERROR message if 'number' and 'multiple' have different signs.
  • If the number is an exact multiple, rounding will not be done. Calci will display the same number as output.

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

MROUND(2.5..7.5, 2) that rounds the numbers from 2.5 to 7.5 to nearest multiple of 2.

Number Multiple MROUND
2.5 2 2
3.5 2 4
4.5 2 4
5.5 2 6
6.5 2 6
7.5 2 8
  • ROUND() can be used to round a number to specified number of digits.
  • ROUNDUP() can be used to round a number away from zero.
  • ROUNDDOWN() can be used to round a number towards zero.

Examples

Function Output
MROUND(3.67,2) 4
MROUND(99,3) 99
MROUND(4.35,0.01) 4.35
MROUND(-89.65,-3) -90

Related Videos

MROUND

See Also

References