Rounding
This page covers rounding inside a calculation: to a number of decimal places or significant figures, to a whole number, and to a step such as the nearest £0.50 or 15 minutes. Reach for it when you need a tidy figure to use further down a note, such as how many tables to hire or what each person should pay.
There are a few different operations, and they are easy to mix up:
- Decimal places keep a certain number of digits after the point: 3.14159 to 2 dp is 3.14.
- Significant figures keep a certain number of digits from the first one that isn’t zero: 12,345 to 3 sf is 12,300.
- Steps round to a multiple of something: 17 to the nearest 5 is 15.
Rounding in a calculation changes the value that later lines use. If you only want an answer to look tidier, try the answer formatting options in the line’s context menu instead.
Decimal places
Add to N dp to a calculation to round its answer:
100 / 7 to 2 dp gives 14.29pi to 5 dp gives 3.141592 kg / 3 to 2 dp gives 0.67 kg14 kg / 3 to 1 dp gives 4.7 kgThese forms all mean the same thing:
| Form | Example | Result |
|---|---|---|
to N dp |
1.23456 to 2 dp |
1.23 |
to N decimal places |
1.23456 to 2 decimal places |
1.23 |
to N digits |
1.23456 to 2 digits |
1.23 |
rounded to N dp |
1.23456 rounded to 2 dp |
1.23 |
rounded to N decimal places |
1.23456 rounded to 2 decimal places |
1.23 |
-> N dp |
1.23456 -> 2 dp |
1.23 |
decimal place works in the singular too, as in 17.456 to 1 decimal place.
to 0 dp rounds to a whole number. Halves round away from zero, so 2.5 to 0 dp is 3 and
-2.25 to 1 dp is -2.3. Units stay attached to the rounded value.
Rounding conversions and function results
Put to N dp straight after a conversion or a function call. A conversion rounds in the unit you
converted to, whether you wrote in or to:
42.195 km to miles to 1 dp gives 26.2 misqrt(2) to 4 dp gives 1.4142average(1, 2, 4) to 2 dp gives 2.33For an answer in two units, such as feet and inches, the decimal places apply to the smaller
unit: 170 cm in feet and inches to 0 dp is 5 feet 7 inches. See
Two-unit answers.
Rounding money
Amounts of money are shown with two decimal places, but the full value is kept for later lines. That usually works in your favour: a third of £100 shows as £33.33, yet three thirds add back up to exactly £100.
£100 / 3 gives £33.33£100 / 3 * 3 gives £100.00Round explicitly when the rounded figure is what really gets paid. Each person below pays £33.33, so the three payments come to £99.99:
share = £100 / 3 to 2 dp gives £33.33share * 3 gives £99.99Significant figures
Scientists, engineers and anyone quoting a rough figure often round to significant figures
instead. Write to N sf, to N significant figures or to N sig figs:
12345.678 to 3 sf gives 12,3000.0012345 to 2 sf gives 0.001212345.678 to 3 significant figures gives 12,300round 987.65 to 2 sig figs gives 990rounded to N sf and round … to N sf work too. Halves round away from zero, and units stay
attached, so sqrt(2 * 9.81 m/s² * 45 m) to 3 sf is 29.7 m/s.
Nearest whole number
rounded after a value, or round(…) around it, gives the nearest whole number:
4.5 rounded gives 54.4 rounded gives 4round(£12.50) gives £13.00Rounding up and down
To force the direction, add up or down. You can put the phrase after the value or in front of
it:
12.3 rounded up gives 1312.7 rounded down gives 12round up 12.3 gives 13round 12.7 down gives 12Rounding up is what you want when a part-filled unit still counts as a whole one:
guests = 23guests / 6 rounded up gives 4round up guests / 6 gives 4round down guests / 6 gives 3Twenty-three guests at tables of six need four tables, and three tables fill up completely. A
leading round up or round down rounds the whole calculation that follows it, so you can put
the phrase wherever it reads best.
Negative numbers
With negative numbers, up means towards positive infinity and down towards negative infinity,
the same way the numbers run on a number line. Plain rounding still rounds halves away from zero:
-2.5 rounded gives -3-2.5 rounded up gives -2-2.5 rounded down gives -3Function forms
| Function | Rounds | Example | Result |
|---|---|---|---|
round(x) |
To the nearest, halves away from zero | round(-2.5) |
-3 |
floor(x) |
Down, towards negative infinity | floor(-2.5) |
-3 |
ceil(x) |
Up, towards positive infinity | ceil(-2.5) |
-2 |
trunc(x) |
Towards zero, dropping the decimal part | trunc(-2.5) |
-2 |
int(x) |
Same as trunc |
int(12.7) |
12 |
floor and ceil work with money and units (ceil(£12.01) is £13.00). trunc and int only
take plain numbers.
Rounding to a step
Add to nearest and a step to round to a multiple of that step. rounded up to nearest and
rounded down to nearest force the direction:
2,340 rounded to nearest 100 gives 2,3002.3 to nearest 0.25 gives 2.25£1,237 rounded up to nearest £100 gives £1,300.00£4.38 rounded to nearest 5p gives £4.40£4.386 to nearest penny gives £4.39$4.38 rounded up to the nearest dollar gives $5.00$2.37 rounded to nearest 50c gives $2.5047 min rounded up to nearest 15 min gives 60 minThe last line is how you might round time on a timesheet to the next quarter of an hour. Write a
money step in coins, such as nearest 5p, nearest 10p or nearest 5 cents, or as an amount,
such as nearest £0.05. Name a coin or currency without a number to round to one of it:
nearest penny, nearest cent, nearest pound, nearest dollar or nearest euro. Every form
also reads to the nearest, as in 17 to the nearest 5. A step in another currency, such as
$4.38 to nearest pound, or a length, weight or time as the step for money, shows an error.
The same phrase works in front of the value, with the direction in either place:
round £1,237 to nearest £50 gives £1,250.00round up £1,237 to nearest £100 gives £1,300.00round £1,237 up to nearest £100 gives £1,300.00Steps with units
A step may use a different unit from the value, as long as they measure the same thing. The step is converted first, and the answer keeps the value’s unit:
1.3 kg rounded up to nearest 500 g gives 1.5 kg3.7 km to nearest 500 m gives 3.5 kmround 1.3 kg to nearest 500 m gives Error: incompatible unitsThe two-argument round
round(x, step) is the function form of rounding to a step:
round(47 min, 15 min) gives 45 minround(£12.345, £0.01) gives £12.35round(5.567, 0.01) gives 5.57Rounding hours and minutes
A duration in hours and minutes rounds as a whole. Plain rounding goes to the nearest hour, and a step such as 15 minutes suits a timesheet:
worked = 1 hour 52 minround(worked) gives 2 hoursworked to nearest 15 min gives 1 hour 45 minworked rounded up to nearest 15 min gives 2 hoursDecimal places apply to the smallest unit, as they do for feet and inches, so worked to 0 dp
leaves 1 hour 52 min as it is. To round to the hour, use round or a step.
Putting it together
Planning food and tables for a garden party:
# Garden partyguests = 42per table = 8tables = guests / per table rounded up gives 6pizzas = guests * 3 / 8 rounded up gives 16pizza price = £11.50pizza bill = pizzas * pizza price gives £184.00each = pizza bill / guests rounded up to nearest £0.50 gives £4.50each * guests gives £189.00Tables and pizzas are rounded up because a part table or part pizza still has to be a whole one. Allowing three slices each from eight-slice pizzas gives 15.75, so you order 16. Each guest’s share is rounded up to a friendly £4.50, and the last line shows that this covers the £184 bill with a little to spare.