Significant Figures Calculator Formula
Understand the math behind the significant figures calculator. Each variable explained with a worked example.
Formulas Used
Rounded
rounded = num != 0 ? round(num / pow(10, floor(log10(abs(num))) - sig_figs + 1)) * pow(10, floor(log10(abs(num))) - sig_figs + 1) : 0Order Mag
order_mag = num != 0 ? floor(log10(abs(num))) : 0Variables
| Variable | Description | Default |
|---|---|---|
num | Number | 123456.789 |
sig_figs | Significant Figures | 4 |
How It Works
Significant Figures
Rules for Counting Significant Figures
1. All nonzero digits are significant (123 has 3 sig figs) 2. Zeros between nonzero digits are significant (102 has 3) 3. Leading zeros are NOT significant (0.0045 has 2) 4. Trailing zeros after a decimal point ARE significant (2.50 has 3) 5. Trailing zeros without a decimal point are ambiguous (1500 could be 2, 3, or 4)
Rounding to n Significant Figures
1. Find the first significant digit 2. Count n digits from there 3. Round at that position
Worked Example
Round 123456.789 to 4 significant figures.
num = 123456.789sig_figs = 4
- 01The first significant digit is 1
- 02Count 4 digits: 1, 2, 3, 4
- 03The next digit (5) rounds up
- 04Result: 123500
Ready to run the numbers?
Open Significant Figures Calculator