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
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{DISPLAYTITLE:FLOOR function}}
 +
{{Documentation/CalcFunc MathematicalTOC
 +
|ShowPrevNext=block
 +
|PrevPage=Documentation/How_Tos/Calc:_CEILING_function
 +
|NextPage=Documentation/How_Tos/Calc:_EVEN_function
 +
}}__NOTOC__
  
 
== FLOOR ==
 
== FLOOR ==
Line 5: Line 10:
  
 
=== Syntax: ===
 
=== Syntax: ===
<tt>'''FLOOR(number; mult; mode)'''</tt>
+
<tt>'''FLOOR(number; significance; mode)'''</tt>
: <tt>'''number'''</tt> is the number that is to be rounded down to a multiple of <tt>'''mult'''</tt>.
+
: <tt>'''number'''</tt> is the number that is to be rounded down to a multiple of <tt>'''significance'''</tt>.
  
 
: If <tt>'''mode'''</tt> is zero or omitted, <tt>'''FLOOR'''</tt> rounds down ''to the multiple below'' (more negative than or equal to) <tt>'''number'''</tt>. If <tt>'''mode'''</tt> is non-zero, <tt>'''FLOOR'''</tt> rounds down towards zero. This difference is only relevant with negative numbers.
 
: If <tt>'''mode'''</tt> is zero or omitted, <tt>'''FLOOR'''</tt> rounds down ''to the multiple below'' (more negative than or equal to) <tt>'''number'''</tt>. If <tt>'''mode'''</tt> is non-zero, <tt>'''FLOOR'''</tt> rounds down towards zero. This difference is only relevant with negative numbers.
  
: Use <tt>'''mode'''</tt><nowiki>=</nowiki><tt>'''1'''</tt> for compability if you have negative numbers and wish to export to MS Excel. In MS Excel this function only takes two arguments.
+
: Use <tt>'''mode'''</tt><nowiki>=</nowiki><tt>'''1'''</tt> for compatibility if you have negative numbers and wish to export to MS Excel. In MS Excel this function only takes two arguments.
  
 
=== Example: ===
 
=== Example: ===
Line 28: Line 33:
 
: returns <tt>'''-10'''</tt>,  because with mode=<tt>'''1'''</tt> the function rounds towards zero.
 
: returns <tt>'''-10'''</tt>,  because with mode=<tt>'''1'''</tt> the function rounds towards zero.
  
{{Documentation/SeeAlso|
+
{{SeeAlso|EN|
 
* [[Documentation/How_Tos/Calc: CEILING function|CEILING]]
 
* [[Documentation/How_Tos/Calc: CEILING function|CEILING]]
 
* [[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 43:
 
* [[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]]
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
* [[Documentation/How_Tos/Calc: Functions listed by category|Functions listed by category]]}}
 
+
[[Category: Documentation/Reference/Calc/Mathematical functions]]
=== Issues: ===
+
In the forthcoming international ODFF standard, <tt>'''mult'''</tt> is an optional parameter. Calc currently returns an error if <tt>'''mult'''</tt> is omitted.
+

Latest revision as of 14:48, 31 January 2024

FLOOR

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

Syntax:

FLOOR(number; significance; mode)

number is the number that is to be rounded down to a multiple of significance.
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 compatibility 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.



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