« Easter formula | Main | Combining data in cells »
March 28, 2005
Rounding functions I
There are almost a dozen available rounding functions available in OOo Calc. We will first look at ROUND(), ROUNDUP() and ROUNDDOWN()ROUND() is the function that is most commonly used. The arguments to this function are
ROUND(number, numdigits) where
- number The number to be rounded.
- numdigits The number of digits you want the number rounded to.
ROUNDUP() and ROUNDDOWN() are similar to BOUND() except the rounding is restrited to a particular direction (up or down) depending on the function that is invoked.
The few examples below show how these two functions produce different results for the same input.
Posted by Dave at March 28, 2005 05:26 AM
Comments
Is it possible to make it go to the nearest nickle? 1.475 down to 1.45 or 1.485 up to 1.50?
Posted by: Bluie at March 29, 2005 07:36 PM
=ROUND(A1*2-0.0001;1)/2
or
=ROUND(A1*2-0,0001;1)/2
depends on your language definitions, decimal point or comma.
Subtraction of small number is needed to round 1.475 down to 1.45.
Posted by: Uros at April 4, 2005 03:21 AM