Explained clearly 5 min read

How to Round to Significant Figures in LaTeX siunitx: A Precision Reference

A comprehensive reference for rounding to significant figures with LaTeX siunitx, including syntax, standards, worked examples, counter-examples, and common pitfalls.

Short Answer

A comprehensive reference for rounding to significant figures with LaTeX siunitx, including syntax, standards, worked examples, counter-examples, and common pitfalls.

Rule Statement: Significant-Figure Rounding in siunitx

LaTeX’s siunitx package provides a precise, standards-aware way to round numbers to significant figures. The core command is \num[round-mode=figures,round-precision=]{}; for quantities with units, use \qty[round-mode=figures,round-precision=]{}{} in siunitx v3, or \SI in v2 compatibility mode. The option round-mode=figures counts significant digits, not decimal places. round-precision is the number of significant figures to retain. The default is round-mode=none, so no rounding occurs unless requested.

Significant figures are the digits that carry measurement meaning: non-zero digits are always significant; zeros between significant digits are significant; leading zeros are never significant; trailing zeros after a decimal point are significant; trailing zeros in an integer without a decimal point are ambiguous unless marked with an overline or expressed in scientific notation. siunitx rounds the input string according to the requested precision but does not infer measurement uncertainty unless you use round-mode=uncertainty.

Tie-breaking is controlled by round-half. Allowed values are up (default), down, and even. For example, \num[round-mode=figures,round-precision=3,round-half=even]{2.345} yields 2.34, while round-half=up yields 2.35. This distinction matters when matching ISO, ASTM, NIST, or GUM conventions. See Rounding Methods and Significant Figures Rules for broader context.

Worked Examples

Example 1: Basic significant-figure rounding

Round 12345.678 to 3 significant figures. The first three significant digits are 1, 2, and 3. The next digit is 4, so round down: 12300. In siunitx:

\num[round-mode=figures,round-precision=3]{12345.678} → 12300. To avoid trailing-zero ambiguity, force scientific notation: \num[round-mode=figures,round-precision=3,scientific-notation=true]{12345.678} → 1.23e4.

Example 2: Small number

Round 0.00123456 to 3 significant figures. Leading zeros are not significant. The first three significant digits are 1, 2, and 3. The next digit is 4, so round down: 0.00123.

\num[round-mode=figures,round-precision=3]{0.00123456} → 0.00123.

Example 3: Tie-breaking

Round 9.8765 to 3 significant figures. The first three digits are 9, 8, and 7. The next digit is 6, so round up: 9.88. For a tie, round 2.345 to 3 significant figures. With round-half=even, the retained digit 4 is even, so keep it: 2.34. With round-half=up, increase it: 2.35.

Counter-Examples

These examples highlight frequent errors when rounding with siunitx.

  • Confusing figures with places: \num[round-mode=places,round-precision=2]{12345.678} gives 12345.68, not 12300. Use round-mode=figures for significant figures.
  • Ignoring leading zeros: Rounding 0.002345 to 2 significant figures is 0.0023, not 0.0024. Leading zeros only locate the decimal point.
  • Assuming trailing zeros are significant: The integer 1200 has two, three, or four significant figures depending on context. Write 1.2 × 10³ or 1.20 × 10³ to remove ambiguity.
  • Double rounding: Rounding 2.445 first to 2.45 and then to 2.4 can produce a different result than rounding directly to two significant figures (2.4 with half-even, 2.5 with half-up). Round once, at the final precision.
  • Using the wrong tie rule: Many standards prefer round-half-to-even, but siunitx defaults to round-half=up. Set round-half=even when required.

Convention Comparison Table

Convention / Standard Tie-breaking Scope siunitx option
ISO 80000-1:2009, 7.3.3 Round half to even Quantities and units; general rounding round-half=even
ASTM E29-22, Section 6 Round half to even Significant digits in test data and conformance round-half=even
NIST SP 811, §7.9 Round half to even SI usage and rounding guidance round-half=even
JCGM 100:2008 (GUM), 7.2.6 Round half to even Measurement uncertainty expression round-half=even
siunitx default Round half up Package default unless changed round-half=up

Always confirm the governing standard for your discipline. The ISO 80000, ASTM E29, GUM Guide, and NIST SP 811 pages on this site provide deeper clause-level notes.

Standards Citation

The following standards are authoritative for significant-figure rounding and reporting:

  • ISO 80000-1:2009, Quantities and units — Part 1: General, Clause 7.3.3: rounding rules, including ties to even.
  • ASTM E29-22, Standard Practice for Using Significant Digits in Test Data to Determine Conformance with Specifications, Section 6: significant-digit rounding for test data.
  • NIST SP 811, Guide for the Use of the International System of Units (SI), §7.9: rounding and significant figures.
  • JCGM 100:2008 (GUM), Evaluation of measurement data — Guide to the expression of uncertainty in measurement, Clause 7.2.6: rounding of uncertainty and results.

These documents agree on the general principle of rounding to the nearest retained digit but specify tie-breaking carefully. siunitx can reproduce any of these conventions through round-half.

Common Mistakes

  • Using round-mode=places when the task asks for significant figures.
  • Forgetting that round-precision must be a positive integer for figures and places.
  • Not setting round-half=even when following ISO, ASTM, NIST, or GUM.
  • Rounding intermediate calculations instead of carrying extra digits and rounding only the final result.
  • Treating integer trailing zeros as significant without overline or scientific notation.
  • Assuming siunitx propagates uncertainty; it formats, but does not compute uncertainty budgets.

Software Behavior Note

siunitx v3.0 and later use \qty for quantities, while \SI remains available in compatibility mode. The rounding engine is deterministic and string-based: it rounds the displayed number, not the underlying floating-point value. This avoids many binary floating-point artifacts but means you should still round only once. For uncertainty-bearing values, round-mode=uncertainty aligns the result and uncertainty digits. Example: \num[round-mode=uncertainty,round-precision=1]{1.234(56)} → 1.2(6). This site’s significant figures calculator complements siunitx by handling bulk calculations, but the reference pages here remain the primary source for rules and standards.

Quick Reference Table

Option Values Effect
round-mode none, figures, places, uncertainty Selects no rounding, significant figures, decimal places, or uncertainty rounding.
round-precision Positive integer Number of significant figures, decimal places, or uncertainty digits.
round-half up, down, even Controls tie-breaking when the next digit is exactly 5.
scientific-notation true, false Forces or suppresses scientific notation to remove trailing-zero ambiguity.
Command \num, \qty, \SI \num for numbers; \qty and \SI for number-unit pairs.

FAQ

How do I round to 3 significant figures in siunitx?

Use \num[round-mode=figures,round-precision=3]{12345.678} for a number, or \qty[round-mode=figures,round-precision=3]{12345.678}{\metre} for a quantity. The result is 12300 or 1.23e4 with scientific notation.

Does siunitx use round-half-to-even by default?

No. The default is round-half=up. To match ISO 80000-1, ASTM E29, NIST SP 811, and GUM, set round-half=even.

How do I round uncertainty in siunitx?

Use round-mode=uncertainty with round-precision. For example, \num[round-mode=uncertainty,round-precision=1]{1.234(56)} yields 1.2(6).

Can siunitx round to decimal places instead?

Yes. Use round-mode=places,round-precision=2 to round to two decimal places. This is not the same as two significant figures.

Verified sources

References

  1. siunitx – A comprehensive (SI) units package, Joseph Wright, CTAN. https://ctan.org/pkg/siunitx
  2. ISO 80000-1:2009, Quantities and units — Part 1: General, Clause 7.3.3.
  3. NIST SP 811, Guide for the Use of the International System of Units (SI), §7.9. https://www.nist.gov/pml/special-publication-811
  4. JCGM 100:2008, Evaluation of measurement data — Guide to the expression of uncertainty in measurement (GUM), Clause 7.2.6. https://www.bipm.org/en/publications/guides/gum.html
  5. ASTM E29-22, Standard Practice for Using Significant Digits in Test Data to Determine Conformance with Specifications, Section 6.

Leave a Reply

Your email address will not be published. Required fields are marked *