Difference between revisions of "Documentation/How Tos/Calc: MROUND function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:MROUND function}}
 +
{{Documentation/CalcFunc MathematicalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_ODD_function
 +
|NextPage=Documentation/How_Tos/Calc:_INT_function
 +
}}__NOTOC__
  
 
== MROUND ==
 
== MROUND ==
Line 5: Line 10:
  
 
This function is only available if the '''Analysis AddIn''' is installed.  
 
This function is only available if the '''Analysis AddIn''' is installed.  
 
  
 
=== Syntax: ===
 
=== Syntax: ===
<tt>'''MROUND(number; mult)'''</tt>
+
<tt>'''MROUND(number; multiple)'''</tt>
: Returns <tt>'''number'''</tt> rounded to the nearest multiple of <tt>'''mult'''</tt>, that is to <tt>'''mult'''</tt> times an integer.
+
: Returns <tt>'''number'''</tt> rounded to the nearest multiple of <tt>'''multiple'''</tt>, that is, to <tt>'''multiple'''</tt> times an integer.
 
+
: An alternative implementation would be  <tt>'''mult * ROUND(number/mult)'''</tt>. 
+
  
 +
: An alternative implementation would be  <tt>'''multiple * ROUND(number/multiple)'''</tt>. 
  
 
=== Example: ===
 
=== Example: ===
Line 21: Line 24:
 
: <tt>'''returns 1.5'''</tt> ( = 0.5*3).
 
: <tt>'''returns 1.5'''</tt> ( = 0.5*3).
  
 +
{{SeeAlso|EN|
 +
* [[Documentation/How_Tos/Calc: CEILING function|CEILING]]
 +
* [[Documentation/How_Tos/Calc: FLOOR function|FLOOR]]
 +
* [[Documentation/How_Tos/Calc: EVEN function|EVEN]]
 +
* [[Documentation/How_Tos/Calc: ODD function|ODD]]
  
=== See also: ===
+
* [[Documentation/How_Tos/Calc: INT function|INT]]
'''[[Documentation/How_Tos/Calc: CEILING function|CEILING]]''',
+
* [[Documentation/How_Tos/Calc: TRUNC function|TRUNC]]
'''[[Documentation/How_Tos/Calc: FLOOR function|FLOOR]]''',
+
* [[Documentation/How_Tos/Calc: ROUND function|ROUND]]
'''[[Documentation/How_Tos/Calc: EVEN function|EVEN]]''',
+
* [[Documentation/How_Tos/Calc: ROUNDDOWN function|ROUNDDOWN]]
'''[[Documentation/How_Tos/Calc: ODD function|ODD]]'''
+
* [[Documentation/How_Tos/Calc: ROUNDUP function|ROUNDUP]]
  
'''[[Documentation/How_Tos/Calc: INT function|INT]]''',
+
* [[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]
'''[[Documentation/How_Tos/Calc: TRUNC function|TRUNC]]''',
+
'''[[Documentation/How_Tos/Calc: ROUND function|ROUND]]''',
+
'''[[Documentation/How_Tos/Calc: ROUNDDOWN function|ROUNDDOWN]]''',
+
'''[[Documentation/How_Tos/Calc: ROUNDUP function|ROUNDUP]]'''
+
  
'''[[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]'''
+
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 +
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 +
[[Category: Documentation/Reference/Calc/Mathematical functions]]

Latest revision as of 14:53, 31 January 2024

MROUND

Returns a number rounded to the nearest multiple of another number.

This function is only available if the Analysis AddIn is installed.

Syntax:

MROUND(number; multiple)

Returns number rounded to the nearest multiple of multiple, that is, to multiple times an integer.
An alternative implementation would be multiple * ROUND(number/multiple).

Example:

MROUND(15.5; 3)

returns 15, as 15.5 is closer to 15 ( = 3*5) than to 18 ( = 3*6).

MROUND(1.4; 0.5)

returns 1.5 ( = 0.5*3).



See Also
Retrieved from "https://wiki.openoffice.org/w/index.php?title=Documentation/How_Tos/Calc:_MROUND_function&oldid=259867"
Views
Personal tools
Navigation
Tools
In other languages