1

I am trying to use siunitx to format numbers. In the following MWE I confused why the "format" of the two numbers is different. Is there a way to automatically format 0.00000 as 0.00 just like 1.000000 is shown as 1.00?

\documentclass{article}
\usepackage{siunitx}
\begin{document}
\noindent
\num[round-precision = 2, round-mode = places]{1.000000} \\
\num[round-precision = 2, round-mode = places]{0.000000}
\end{document}
2
  • 3
    I cant confirm your founding. Both numbers has the same number of decimal digits (2).
    – Zarko
    Jun 26, 2021 at 3:34
  • 1
    I get "1.00" and "0.00" as expected. There were lots of updates after the v3 release. I run 2021-06-22 v3.0.15 (edit just updated to 2021-06-24 v3.0.16, same expected result). What version do you have?
    – moewe
    Jun 26, 2021 at 6:31

1 Answer 1

2

This was an issue in the v3.0.0 release, was reported as issue #477 and was fixed in commit 8a05d7. This was part of v3.0.12, released on 2021-06-09.

3
  • Using 3.1.4 it does not work in an S column of table, though.
    – Adam
    Nov 23, 2022 at 16:31
  • @Adam I am nor sure what you mean: could you post a new question with an example of the issue?
    – Joseph Wright
    Nov 23, 2022 at 16:56
  • Yes, but it would be more of a bug report, not at question. I meant rounding 0.0000 does not work as expected in an S column in a table with round-mode=figures.
    – Adam
    Nov 25, 2022 at 13:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .