4

I want to display 2.00 m instead of 2 m, even if the leading number is not a decimal number (= is an integer).

Unfortunately all \sisetup-commands I tried did not work...

Minimum Working Example (MWE):

\documentclass{article}
\usepackage{siunitx}

\begin{document}

    \SI{2}{\meter}

\end{document}
TeXnician
  • 33,589
Dave
  • 3,758

1 Answers1

12

You need to round and convert integers to decimals

\documentclass{article}
\usepackage{siunitx}
\sisetup{round-mode = places, round-precision = 2, round-integer-to-decimal}

\begin{document}

    \SI{2}{\metre}

\end{document}

(Probably in v3, in development, you won't need round-integer-to-decimal: I suspect this was one of my less-good ideas!)

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • 1
    Man, I was looking for that since one hour... :-) Thanks a lot! – Dave Jun 17 '18 at 11:06
  • 1
    @Dave - For more in-depth information on the topic of your query, do check out Section 5.5 of the user guide of the siunitx package, beginning on p. 22. – Mico Jun 17 '18 at 11:29