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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
Line 5: Line 5:
  
 
This function is only available if the '''Analysis AddIn''' is installed.  
 
This function is only available if the '''Analysis AddIn''' is installed.  
 
  
 
=== Syntax: ===
 
=== Syntax: ===
Line 12: Line 11:
  
 
: An alternative implementation would be  <tt>'''mult * ROUND(number/mult)'''</tt>.   
 
: An alternative implementation would be  <tt>'''mult * ROUND(number/mult)'''</tt>.   
 
  
 
=== Example: ===
 
=== Example: ===
Line 20: Line 18:
 
<tt>'''MROUND(1.4; 0.5)'''</tt>
 
<tt>'''MROUND(1.4; 0.5)'''</tt>
 
: <tt>'''returns 1.5'''</tt> ( = 0.5*3).
 
: <tt>'''returns 1.5'''</tt> ( = 0.5*3).
 
  
 
=== See also: ===
 
=== See also: ===

Revision as of 06:33, 2 March 2008


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; mult)

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

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:

CEILING, FLOOR, EVEN, ODD

INT, TRUNC, ROUND, ROUNDDOWN, ROUNDUP

Mathematical functions

Personal tools