# siunitx displaying wrong uncertainty values for integers

I am getting incorrect uncertainties displayed for integer-valued numbers using the siunitx package. It seems to insert one decimal place and divide the uncertainty I specify by 10.

This is a new problem since upgrading to the 2014-09-29 package version.

\documentclass{article}

\usepackage{siunitx}
\sisetup{separate-uncertainty = true} % use +/- symbol for uncertainty values

\begin{document}

Using integers,

\verb+\num{30 \pm 2}+ gives \num{30 \pm 2}

but I want the value to appear as \num{30}

and the uncertainty should be \num{\pm 2} with no decimal parts.

Same problem happens using \verb+\SI+ and in tables using S-columns.

Things seem to work fine if the base value is not an integer:

\verb+\num{30.5 \pm 2}+ gives \num{30.5 \pm 2}

\end{document}

• This seems like a bug in siunitx; with the version in TeX Live 2013 I get “30 ± 2”. – egreg Oct 2 '14 at 20:20
• In such cases the best is to inform the author @JosephWright. – Ulrike Fischer Oct 3 '14 at 12:25
• This will be fixed in the next release of the package – Joseph Wright Oct 7 '14 at 14:39
• This bug seems similar to a bug I have just posted about here tex.stackexchange.com/questions/446074/… – Ross Aug 14 '18 at 22:00

\num{30(2)}

This works for me, if I only change the uncertainty in the \num command.
• That works! Now, any tips on how to replace dozens of instances of \pm x with (x)? – Scott Oct 2 '14 at 18:24
• I figured out how to use regexp in TeXworks' replace function: Put ([0-9\.]*) \\pm ([0-9\.]*) in the Replace: field and \1(\2) in the With: field, and run the magic with Replace or Replace All. – Scott Oct 2 '14 at 20:35