CCalclabhub

Arithmetic

Rounding to a number of significant figures

Shift the decimal point so the last kept digit becomes the final digit, round, then shift back.

Last updated

The Formula

rounded = round(x, sigFigs - 1 - floor(log10(|x|)))

Shift the decimal point so the last kept digit becomes the final digit, round, then shift back.

SymbolMeaning
xInput
nSignificant figures
log10(|x|)Order of magnitude
roundedResult

What Each Symbol Means

xany unit

Input

The number being rounded.

nunitless

Significant figures

How many digits to keep.

log10(|x|)unitless

Order of magnitude

The power of ten the number starts at.

roundedsame unit

Result

The number carrying exactly n significant figures.

See It Worked With Real Numbers

A formula on its own does not tell you which number goes where. The how to count significant figures page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.

Where This Formula Appears

This equation is the working core of How To Count Significant Figures, filed under Math. Every number the guide produces comes from substituting into this one line.

Common Questions

What is the formula for Rounding to a number of significant figures?

The formula for Rounding to a number of significant figures is rounded = round(x, sigFigs - 1 - floor(log10(|x|))). Shift the decimal point so the last kept digit becomes the final digit, round, then shift back.

What does each symbol in Rounding to a number of significant figures stand for?

x is input; n is significant figures; log10(|x|) is order of magnitude; rounded is result.

What units should I use with Rounding to a number of significant figures?

Substitute x in any unit, n in unitless, log10(|x|) in unitless, rounded in same unit. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.

What is a common mistake when using Rounding to a number of significant figures?

Counting leading zeros as significant. Zeros before the first non-zero digit only fix the place value. 0.0072151 has seven significant figures, not nine, and counting the leading zeros invents precision.