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.
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.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| x | Input | any unit | The number being rounded. |
| n | Significant figures | unitless | How many digits to keep. |
| log10(|x|) | Order of magnitude | unitless | The power of ten the number starts at. |
| rounded | Result | same unit | The number carrying exactly n significant figures. |
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.