Skip to content
Quaestio

Rounding

Choose decimal places or significant figures, and the result appears under each of the common rules.

Negative values round to tens, hundreds and so on.

Result under each rule

  • Nearest, halves upmost commonWhat rounding normally means.3.14
  • Nearest, halves to evenBanker’s rounding, used in accounting and statistics.3.14
  • Always upTowards positive infinity.3.15
  • Always downTowards negative infinity.3.14
Embed

Embed this tool on your site

Copy the code and paste it where the tool should appear, such as a blog post or a school page. It is free, the box has no ads and the tool calculates in the visitor’s browser.

How it works

Rounding to decimal places decides how many digits sit after the decimal point. Significant figures instead count every digit that carries information, starting from the first one that is not zero. 0.00012345 has five significant figures.

The rule most people mean by rounding is nearest value, with halves going away from zero. That turns 2.5 into 3 and −2.5 into −3.

Banker’s rounding sends halves to the nearest even number instead, so 2.5 becomes 2 while 3.5 becomes 4. It is used in accounting and statistics because it does not push a total upwards when many numbers are rounded.

Up and down always move the same way along the number line, however close the other value is. For negative numbers, up therefore means towards zero.

This tool shifts the decimal point through the number’s text form rather than multiplying. That is why 1.005 rounds to 1.01, while a plain multiplication gives 1.00 because 1.005 is actually stored as something just below it.

A negative number of decimal places rounds the other way: −1 gives the nearest ten and −2 the nearest hundred.

What the standard says about halves

The tool labels halves up as the most common rule, but the rounding rules in NIST’s guide to SI units, which refers to ISO 31-0, send halves to even. A digit followed by a 5 and nothing but zeros is left unchanged if it is even and raised by one if it is odd. The last digit is then always even.

NIST’s example is 6.9749505 rounded to seven digits, which gives 6.974950. Choose seven significant figures in the tool and halves to even gives the same answer, while halves up gives 6.974951. The point of the rule is that halves go up and down equally often, so repeated rounding does not drift in one direction.

The number as written, not as stored

A computer stores 2.675 as 2.67499999999999982236431605997495353221893310546875, just below the half. Rounding the stored value therefore gives 2.67. This tool moves the decimal point in the number’s text form and rounds 267.5, so it answers 2.68 with both halves up and halves to even, since eight is even.

With significant figures the tool first works out the order of magnitude and rounds at the right place. If rounding lifts the number into the next power of ten, the place is worked out again from the new magnitude. The answer is then written with exactly as many significant figures as you chose, so 9.995 to three significant figures is shown as 10.0, the zero after the point being the third significant figure.

Rounding elsewhere

JavaScript has a built-in rounding that sends halves towards plus infinity, so −2.5 becomes −2. The tool therefore mirrors negative numbers before rounding and gives −3 with halves up. The round function in the scientific calculator, by contrast, uses the built-in version directly and gives −2.

The number of decimal places can be set from −10 to 15, and significant figures from 1 to 15. The answer is written with exactly as many decimal places as you asked for, so 1 rounded to two places is shown as 1.00.

Sources

How the tools are checked