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

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
Line 3: Line 3:
 
== INT ==
 
== INT ==
 
Rounds a number down to the nearest integer.
 
Rounds a number down to the nearest integer.
 
  
 
=== Syntax: ===
 
=== Syntax: ===
 
<tt>'''INT(number)'''</tt>
 
<tt>'''INT(number)'''</tt>
 
: returns <tt>'''number'''</tt> rounded down to the nearest integer.
 
: returns <tt>'''number'''</tt> rounded down to the nearest integer.
 
  
 
: Negative numbers round down to the integer below: <tt>'''-1.3'''</tt> rounds to <tt>'''-2'''</tt>.
 
: Negative numbers round down to the integer below: <tt>'''-1.3'''</tt> rounds to <tt>'''-2'''</tt>.
 
  
 
=== Example: ===
 
=== Example: ===
Line 19: Line 16:
 
<tt>'''INT(-1.3)'''</tt>
 
<tt>'''INT(-1.3)'''</tt>
 
: returns <tt>'''-2'''</tt>.
 
: returns <tt>'''-2'''</tt>.
 
  
 
=== See also: ===
 
=== See also: ===

Revision as of 06:30, 2 March 2008


INT

Rounds a number down to the nearest integer.

Syntax:

INT(number)

returns number rounded down to the nearest integer.
Negative numbers round down to the integer below: -1.3 rounds to -2.

Example:

INT(5.7)

returns 5

INT(-1.3)

returns -2.

See also:

TRUNC, ROUND, ROUNDDOWN, ROUNDUP

CEILING, FLOOR, EVEN, ODD, MROUND

Mathematical functions

Personal tools