The Standard Engine.
MathematicsFinanceHealthPhysicsEngineeringBrowse all

Everyday Life · General Mathematics

Rounding Calculator

Rounds any number to a specified number of decimal places or significant figures using standard rounding rules.

Calculator

Advertisement

Formula

x is the original number, n is the number of decimal places desired. The number is multiplied by 10 raised to the power of n, then the floor of that value plus 0.5 is taken (which rounds half-up), and finally divided back by 10 to the n. For significant figures, n is determined by the magnitude of the number relative to the desired count of significant digits.

Source: ISO 80000-1:2022 — Quantities and units, General; standard arithmetic rounding conventions.

How it works

Rounding is the process of reducing the number of digits in a value while keeping it as close as possible to the original. There are two primary conventions: rounding to decimal places, which controls how many digits appear after the decimal point, and rounding to significant figures, which controls the total number of meaningful digits in a number regardless of its magnitude. Both are governed by the half-up rule: if the digit immediately after the cut-off point is 5 or greater, the last retained digit is increased by one; otherwise it stays the same.

For decimal places, the formula multiplies the number by 10 raised to the power of the desired decimal places, applies the floor function after adding 0.5 (implementing half-up rounding), and divides back. For example, rounding 3.14159 to 2 decimal places: multiply by 100 to get 314.159, add 0.5 to get 314.659, take the floor to get 314, then divide by 100 to get 3.14. For significant figures, the magnitude of the number (via its base-10 logarithm) is used to determine the correct power of ten before applying the same rounding step, so that a number like 0.004567 rounded to 3 significant figures correctly gives 0.00457 rather than 0.005.

Rounding appears in virtually every quantitative discipline. Scientists round to reflect the precision of their instruments; accountants round currency to two decimal places by law in many jurisdictions; engineers round intermediate results to avoid false precision in final answers; and students round to match the precision requirements of exam mark schemes. Understanding both modes — decimal places and significant figures — is crucial because they answer different questions: decimal places define absolute precision, while significant figures define relative precision.

Worked example

Example 1 — Rounding to Decimal Places:
Round 7.8654 to 2 decimal places.
Step 1: Multiply by 10² = 100: 7.8654 × 100 = 786.54
Step 2: Add 0.5: 786.54 + 0.5 = 787.04
Step 3: Take the floor: ⌊787.04⌋ = 787
Step 4: Divide by 100: 787 ÷ 100 = 7.87
The digit in the third decimal place was 5, so the second decimal place rounds up from 6 to 7. Result: 7.87. Rounding difference = 7.8654 − 7.87 = 0.0046.

Example 2 — Rounding to Significant Figures:
Round 0.0048392 to 3 significant figures.
Step 1: The first significant digit is in the 4th decimal place (the 4). log₁₀(0.0048392) ≈ −2.315, so ⌊log₁₀⌋ = −3.
Step 2: Power of ten = 10^(−3 − (3−1)) = 10^(−5) = 0.00001
Step 3: Divide by 0.00001: 0.0048392 ÷ 0.00001 = 483.92
Step 4: Round to nearest integer: 483.92 → 484
Step 5: Multiply back: 484 × 0.00001 = 0.00484
Result: 0.00484 (3 significant figures: 4, 8, 4).

Limitations & notes

This calculator uses the half-up (round half away from zero for positives) rounding rule, which is the most common convention in everyday use, education, and many financial contexts. However, other rounding conventions exist and may be required in specific situations: half-even (banker's rounding) rounds ties to the nearest even digit to reduce cumulative bias over many operations — this is used in IEEE 754 floating-point arithmetic and some statistical software. Half-down and truncation (floor rounding) are used in certain tax and billing systems. Always verify which rounding convention applies in your specific professional or regulatory context. Additionally, due to the inherent limitations of binary floating-point representation, very large numbers or numbers with many decimal places may exhibit tiny floating-point precision artefacts in the displayed difference; these are computational in nature and not errors in the rounding logic.

Frequently asked questions

What is the difference between rounding to decimal places and rounding to significant figures?

Decimal places count digits after the decimal point, so 1234.5678 rounded to 2 decimal places is 1234.57. Significant figures count all meaningful digits from the first non-zero digit, so 1234.5678 rounded to 4 significant figures is 1235. Significant figures are most useful in science and engineering where relative precision matters, while decimal places are standard in currency and everyday measurement.

Why does 2.5 round to 3 and not 2 in this calculator?

This calculator uses the half-up rule: when a number is exactly halfway between two values, it rounds toward positive infinity (i.e., up for positive numbers). So 2.5 rounds to 3 and −2.5 rounds to −2. The alternative, banker's rounding (half-even), would round 2.5 to 2 because 2 is the nearest even number, but half-up is the standard taught in most schools and used in most everyday contexts.

How many significant figures should I use in scientific work?

As a general rule, your final answer should contain no more significant figures than the least precise measurement you started with. For example, if you measure a length to 3 significant figures and a width to 2 significant figures, your calculated area should be reported to 2 significant figures. Always consult your laboratory guidelines, journal requirements, or exam mark scheme for the specific precision expected.

What does the rounding difference (error) tell me?

The rounding difference, also called the rounding error or absolute error, is the absolute difference between your original number and the rounded result. It tells you how much precision you have sacrificed by rounding. For example, rounding 3.14159 to 2 decimal places gives a difference of 0.00159. The percentage error expresses this as a fraction of the original number, allowing you to assess the relative impact of rounding.

Can this calculator handle very large or very small numbers?

Yes, the calculator works with JavaScript's 64-bit double-precision floating-point numbers, which can represent values from approximately 5 × 10⁻³²⁴ to 1.8 × 10³⁰⁸. For numbers at the extreme ends of this range, or numbers requiring more than about 15 significant figures, you may encounter floating-point precision artefacts. For cryptographic, banking, or high-precision scientific work, dedicated arbitrary-precision libraries should be used instead.

Last updated: 2025-01-15 · Formula verified against primary sources.