Advertisement

Rounding calculator

Choose decimal places or significant digits. Ties round away from zero, so 2.675 to two decimal places becomes 2.68.

Calculator

Rounding uses the decimal spelling of the numeric value; very long entries can lose digits before rounding.

Decimal places: 0 to 100. Significant digits: 1 to 100.

Rounded value
2.68

Advertisement

How this calculator works

Decimal-place rounding keeps a chosen number of digits after the point. Significant-digit rounding starts counting at the first non-zero digit. The calculator parses the received number into decimal digits and performs integer rounding, avoiding binary multiplication errors at ties such as 2.675. Halfway cases go away from zero. Redundant trailing zeros are omitted.

Formula

At the chosen place, discard smaller digits and add one to the retained magnitude when the discarded part is at least half a unit. For s significant digits and decimal order e, round to s - 1 - e decimal places.

Worked example

2.675 to two decimal places is 2.68, and -2.675 is -2.68. Rounding 3.14159 to three places gives 3.142. Rounding 0.004567 to two significant digits gives 0.0046.

Advertisement

Frequently asked questions

Is this banker's rounding?

No. Banker's rounding sends ties to an even retained digit. This tool uses half-up rounding on the magnitude, which sends negative ties away from zero too.

Can it round arbitrarily long decimal text?

The input is numeric, with about 15 to 17 significant digits of precision. Decimal rounding is exact for the spelling of the received value, but cannot recover digits lost at input.

Why are trailing zeros removed?

The output shows the rounded numeric value. It does not encode a measurement uncertainty or guarantee a count of significant figures through trailing zeros.

Sources

Advertisement