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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Automated text replacement %s)
m (Robot: Automated text replacement %s)
Line 32: Line 32:
 
* [[Documentation/How_Tos/Calc: EVEN function|EVEN]]
 
* [[Documentation/How_Tos/Calc: EVEN function|EVEN]]
 
* [[Documentation/How_Tos/Calc: ODD function|ODD]]
 
* [[Documentation/How_Tos/Calc: ODD function|ODD]]
* [[Documentation/How_Tos/Calc: MROUND function|MROUND]]'''
+
* [[Documentation/How_Tos/Calc: MROUND function|MROUND]]
  
 
* [[Documentation/How_Tos/Calc: INT function|INT]]
 
* [[Documentation/How_Tos/Calc: INT function|INT]]
Line 38: Line 38:
 
* [[Documentation/How_Tos/Calc: ROUND function|ROUND]]
 
* [[Documentation/How_Tos/Calc: ROUND function|ROUND]]
 
* [[Documentation/How_Tos/Calc: ROUNDDOWN function|ROUNDDOWN]]
 
* [[Documentation/How_Tos/Calc: ROUNDDOWN function|ROUNDDOWN]]
* [[Documentation/How_Tos/Calc: ROUNDUP function|ROUNDUP]]'''
+
* [[Documentation/How_Tos/Calc: ROUNDUP function|ROUNDUP]]
  
* [[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]'''
+
* [[Documentation/How_Tos/Calc: Mathematical functions|Mathematical functions]]
  
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]
 
* [[Documentation/How_Tos/Calc: Functions listed alphabetically|Functions listed alphabetically]]

Revision as of 14:09, 26 February 2009


FLOOR

Returns a number rounded down to a multiple of another number.

Syntax:

FLOOR(number; mult; mode)

number is the number that is to be rounded down to a multiple of mult.
If mode is zero or omitted, FLOOR rounds down to the multiple below (more negative than or equal to) number. If mode is non-zero, FLOOR rounds down towards zero. This difference is only relevant with negative numbers.
Use mode=1 for compability if you have negative numbers and wish to export to MS Excel. In MS Excel this function only takes two arguments.

Example:

FLOOR(8; 3)

returns 6, because 2*3 = 6 is the first multiple of 3 below 8.

FLOOR(6; 3)

returns 6.

FLOOR( -11; -2)

returns -12, rounding to the multiple below.

FLOOR( -11; -2; 0)

returns -12.

FLOOR( -11; -2; 1)

returns -10, because with mode=1 the function rounds towards zero.

Template:Documentation/SeeAlso

Issues:

In the forthcoming international ODFF standard, mult is an optional parameter. Calc currently returns an error if mult is omitted.

Personal tools