Rounding Calculator
Result
Rounded value
- Truncated value (same place)
- 1234
Rounding replaces a number with a nearby one that is easier to write, and there are two decisions in it that people usually make without noticing. The first is where to round to: the nearest whole number, the nearest ten, the nearest hundredth, or a given number of significant figures. The second is what to do when the value sits exactly halfway, and that is where two reasonable conventions disagree. Rounding half up moves a half away from zero, so 2.5 becomes 3 and −2.5 becomes −3; this is what schools teach and what most people mean by rounding. Truncation moves the value towards zero instead, so 2.5 becomes 2 and −2.5 becomes −2; it is simpler to define and is what a great deal of software actually does. This page takes the place as an input and prints both results at that same place, so the difference is visible rather than assumed. The place itself can be named two ways. Naming a decimal place is the direct one: whole numbers, tens, hundreds, thousandths, down to three decimal places in either direction. Naming significant figures is the one used in science, where the count starts from the first non-zero digit rather than from the decimal point, so 1567 to two significant figures is 1600 — the same answer as rounding to the nearest hundred, reached by a different route. For a number of a given size the two namings often coincide, and for 1234.5678 the six significant-figure options land on the same places as the six decimal ones. Trailing zeros are kept, because they carry information: 1234.6 to one decimal place and 1234.57 to two are different claims about how precisely the number is known, and dropping the zero would erase the difference. The second output is the truncated value at the same place, which is the cheapest way to see what the halfway rule is doing on your number. Note what is not here: this page rounds one number at a time and does not carry significant-figure arithmetic through a calculation, where the answer's precision is limited by its least precise input and trailing zeros need to survive as digits rather than as values.
1234.5678 rounded and truncated at each of the seven decimal places
| place | rounded | truncated |
|---|---|---|
| 1000 | 1000 | 1000 |
| 100 | 1200 | 1200 |
| 10 | 1230 | 1230 |
| 1 | 1235 | 1234 |
| 0.1 | 1234.6 | 1234.5 |
| 0.01 | 1234.57 | 1234.56 |
| 0.001 | 1234.568 | 1234.567 |
The first three rows disagree with nothing, because rounding to a large place discards the whole decimal part and the two conventions both land on the same thousands: at the nearest thousand, the nearest hundred and the nearest ten, 1234.5678 gives 1000, 1200 and 1230 either way. The disagreements start at the whole number, where half up gives 1235 and truncation gives 1234, and they are visible in every row below it for the same reason — the 5 in the first decimal place is a genuine halfway case at the whole-number place, and the .5678 keeps the later rows off their halfway points. Note that the answer's number of decimal places is set by the row: the nearest thousand has none, and the nearest thousandth keeps three, so trailing zeros appear and stay. The last six options, the significant-figure ones, are not in this table because their place depends on how large the number is; for 1234.5678 they happen to fall on the same six places as the rows above, so one to six significant figures give the same pairs of numbers shown here. The table is fixed at 1234.5678, which is also the default value, so on first load it explains the answer already on screen; it does not follow your input.
Formula
1234.5678 to the nearest whole number ⇒ 1235 half-up, 1234 truncated; 2.5 ⇒ 3 or 2; 1567 to 2 significant figures ⇒ 1600
- 1234.5678
- The value to round, any number from −1000000000 to 1000000000, decimals included. This is also the number the reference table below is built from, so the table's seven rows are the seven placings of the value already on screen
- p0, pm2, s2
- Where to round to, chosen from thirteen options in one list. The p options name a decimal place: p3 is the nearest thousand, p0 the nearest whole number, pm2 the nearest hundredth. The s options name a count of significant figures, s1 through s6, counted from the first non-zero digit
- round half up
- The rule for the halfway case: a value exactly between two candidates moves away from zero, so 2.5 becomes 3 and −2.5 becomes −3. It is the convention taught in schools. It is also the one that looks like a bug when a long run of .5 values is summed, since every one of them is pushed in the same direction
- truncated
- The second output, and the other half of the halfway question: the same value at the same place with the extra digits discarded rather than rounded, which always moves towards zero. 2.5 truncates to 2 and −2.5 to −2. Printing it beside the rounded value is what makes the convention visible, since on most inputs the two outputs are identical
- 1567 → 1600
- Significant figures in action. The count starts at the first non-zero digit, so 1567 to two significant figures keeps the 1 and the 5 and rounds the rest, giving 1600. The trailing zeros stay: the answer claims two significant figures, and writing 1600 as 1600 is the only way a reader can see that claim
- 1.005 → 1.01
- Why the arithmetic is done on the decimal digits rather than by multiplying and dividing in floating point. 1.005 is stored as a value slightly below 1.005, so the usual double-precision route rounds it down to 1.00; working on the digits gives the answer a person expects, 1.01. The example below pins this case
Reporting a measurement is the classic case, and it is where significant figures come from: a length read off a ruler to the nearest millimetre should not be reported to six decimal places, because the extra digits claim a precision the instrument never had. Significant figures are the notation that keeps that claim honest, and they are why rounding a measurement is not the same as rounding a number in a puzzle. Money is the everyday version of a decimal place — prices are rounded to the nearest hundredth, and the halfway rule is a real policy question because it decides which way a fraction of a cent goes, and over many transactions a rule that always pushes the same way produces a visible drift. Statistics and reporting round for readability: percentages to one decimal place, populations to the nearest thousand, averages to the same precision as their inputs. Truncation has its own uses, and they are the reason it is printed here rather than omitted: taking a floor or a ceiling towards zero is what a lot of programming languages do by default, and it is what appears when a value is stored in a format with fixed precision. In every one of these settings the rule to keep in mind is that rounding twice is not the same as rounding once, and that a rounded number is a claim about precision rather than just a shorter way of writing the original. Arithmetic on rounded values compounds the difference, which is why the significant-figure version of that problem is a separate tool from this one.
Worked examples
1234.5678 to the nearest whole number
- The candidates either side of 1234.5678 are 1234 and 1235
- The digit deciding it is the first decimal, 5
- Half up treats 5 as a reason to move away from zero, so the value rounds up to 1235
- The .5678 that follows does not change this — the digit in the rounding position is what decides, and everything after it only breaks ties
- Truncation discards the decimal part instead, giving 1234
The default, and the sample the reference table below is built from. The 5 in the first decimal place is doing all the work: the 6, the 7 and the 8 after it are irrelevant, and a value of 1234.5001 would round exactly the same way. The two outputs differ here, which is the convenient case — on most inputs half up and truncation agree, and the pair of numbers is what tells you whether the halfway rule was involved.
The halfway case: 2.5 to the nearest whole number
- 2.5 sits exactly halfway between 2 and 3
- Half up moves away from zero, so the rounded value is 3
- Truncation moves towards zero, so the truncated value is 2
- Neither is a mistake; they are two conventions for the same input
The smallest case that shows the disagreement, and the one worth remembering. Half up is not the only convention in use: bankers' rounding would take 2.5 to the even neighbour, 2, which matters over long lists of measurements because always rounding halves upwards introduces a small upward bias. This page uses half up — the school convention — and says so rather than leaving it to be discovered.
A negative halfway value: −2.5 to the nearest whole number
- −2.5 sits halfway between −3 and −2
- Half up moves away from zero, and away from zero on the negative side means further down, so the answer is −3
- Truncation moves towards zero, giving −2
- The sign is handled by the distance from zero, not by the direction along the number line
The case that separates half up from 'always round up'. Both values here move by the same rule — away from zero — but on the number line they move in opposite directions, because zero is in the middle. Any code or rule described as 'rounds up' without qualification is ambiguous for exactly this reason, and the reference table's negative rows show the same effect at other places.
1.005 to two decimal places
- The candidates are 1.00 and 1.01
- The digit deciding it is the third decimal, 5, which is exactly the halfway case
- Half up moves away from zero, so the value rounds to 1.01
- Truncating discards the 5 and keeps 1.00, with the trailing zero kept so the precision is visible
The example that justifies the implementation. The obvious route — multiply by 100, round, divide by 100 — gives 1.00, because 1.005 cannot be stored exactly and the value that is stored is a hair below 1.005. The answer a person expects is 1.01, and that is what working on the decimal digits produces. The same thing happens at many everyday values, so a result that is off by one in the last place is usually this rather than a mistake in the rule.
1567 to two significant figures
- The first significant figure is the 1, in the thousands place; the second is the 5
- Two significant figures means keeping those two digits and rounding at the hundreds
- The digit after them is 6, which rounds the 5 up, so the value becomes 1600
- The trailing zeros stay, because they are what records that two significant figures were kept
- Truncating at the same place gives 1500
The same answer as rounding to the nearest hundred, reached from the other end. Note what the output cannot tell you: 1600 written as a plain number is indistinguishable from 1600 rounded to the nearest whole number, or from a measurement that happened to be exactly 1600. Keeping the zeros is the most this notation can do, and carrying significant figures through a calculation — where the count has to survive multiplication and division — is a separate problem from rounding a single value.
Limitations
The value must be between −1000000000 and 1000000000, decimals included, and the place is chosen from thirteen options rather than typed, so there is no way to ask for a place outside that list. Rounding is done on the decimal digits of the value as written, not by scaling in floating point, so results match what the digits say — 1.005 to two decimal places is 1.01 here, where the usual multiply-and-divide route gives 1.00. The same choice has a visible consequence: results are always printed with a decimal point and never with thousands separators, so a reader who typed a comma as the decimal mark sees a point in the answer. This is deliberate and matches the other pages that print text results. Trailing zeros are kept, because they record the precision the answer claims, which means 1234.6 and 1234.60 are different outputs from different places and are not written the same way. Negative values are rounded by distance from zero, so a halfway negative value moves down the number line rather than up. The reference table below is fixed at 1234.5678 and does not follow your input; it shows the first seven options applied to that one number, and the six significant-figure options are described in its note rather than given rows of their own. There is no rounding of a running total here, and nothing accumulates: this page rounds one value per calculation.
Frequently asked questions
- What does round half up mean?
- That a value sitting exactly halfway between two candidates moves away from zero: 2.5 becomes 3 and −2.5 becomes −3. It is the convention schools teach and the one this page uses. It is not the only one in use — bankers' rounding sends a half to the even neighbour instead, which avoids the small upward bias that always rounding halves up introduces over long lists of values.
- What is the difference between decimal places and significant figures?
- Decimal places count from the decimal point; significant figures count from the first non-zero digit. 1567 to two significant figures is 1600, the same as rounding to the nearest hundred, while 1567 to two decimal places is 1567.00. Significant figures are the notation used for measurements, because the count does not change when the same quantity is written in different units.
- Why does 1.005 round to 1.01 and not 1.00?
- Because the value is on the halfway point and the page rounds halves away from zero, working on the decimal digits rather than by scaling in floating point. The common route of multiplying by 100, rounding and dividing by 100 gives 1.00, since 1.005 is stored as a value slightly below 1.005. The digit-based answer is 1.01, which is what the rule says and what a person writing the number down would produce.
- What is truncation and why show it?
- Truncation discards the extra digits instead of rounding them, which always moves the value towards zero: 2.5 becomes 2 and −2.5 becomes −2. It is printed beside the rounded value at the same place because the pair is the clearest way to see whether the halfway rule was involved — on inputs away from a halfway point the two outputs agree, and where they differ the convention is what made the difference.
- Are the trailing zeros significant?
- Yes, and they are kept deliberately. 1234.6 to one decimal place and 1234.57 to two decimal places are different claims about how precisely the value is known, and dropping the trailing zero would erase the difference. The same applies to a whole number rounded to significant figures: 1600 keeps its zeros because they are what records that two significant figures were kept.
- Does this page round significant figures through a calculation?
- No. It rounds one value at a time, and it does not carry a precision through a chain of arithmetic, where the result is limited by the least precise input and intermediate values have to be kept unrounded until the end. That is a separate problem from rounding a single number, because it needs the significant-figure count to survive multiplication and division, which a plain rounded value cannot represent.
References
- Rounding — the definition, the halfway rules including round-half-up and round-half-to-even, and how the choice affects accumulated results — Wolfram MathWorld (United States)
- Significant digits — how the count starts at the first non-zero digit, and why trailing zeros record precision rather than value — Wolfram MathWorld (United States)
- Nearest integer function — the special case of rounding to the nearest whole number, and the tie-breaking conventions defined for it — Wolfram MathWorld (United States)
- 教育部关于印发义务教育课程方案和课程标准(2022 年版)的通知——The fifth item in the annex list of this notice is the Mathematics Curriculum Standards for Compulsory Education (2022 edition); the meaning of decimals, finding approximations and rounding are part of the Number and Algebra strand of these standards, and the wording of the standards and the grade-band breakdown are governed by that annex — 中华人民共和国教育部