17

That's my MWE:

\documentclass[a4paper,10pt]{book}

\usepackage[load=addn,separate-uncertainty=true]{siunitx}

\sisetup{%
      output-decimal-marker={,},
      load-configurations=abbreviations,
      group-separator={.},
      per-mode=fraction
    }

\begin{document}
    \SI{12345.66666666}{\kilo\meter\per\hour}
\end{document}

The result has been being 12.345,666.666.66, but I want 12.345,66666666.

1 Answer 1

22

The group-digits option is a choice key, which has the possible values true,false,integer or decimal. In this case, only the integer part of the number should have group digits, so use group-digits=integer.

\documentclass[a4paper,10pt]{book}

\usepackage[load=addn,separate-uncertainty=true]{siunitx}

\sisetup{%
      output-decimal-marker={,},
      load-configurations=abbreviations,
      group-separator={.},
      per-mode=fraction,
      group-digits=integer
    }

\begin{document}
    \SI{12345.66666666}{\kilo\meter\per\hour}
\end{document}

enter image description here

Updated due to the comment

\documentclass[a4paper,10pt]{book}

\usepackage[separate-uncertainty=true]{siunitx}

\sisetup{%
  output-decimal-marker={,},
  group-separator={.},
  group-minimum-digits=4,
  per-mode=fraction,
  group-digits=integer
}

\begin{document}
\num{62034.023458763e23} 


\num{6232.023458763e23} 

\SI{12345.66666666}{\kilo\meter\per\hour}
\end{document}
2
  • Hi. It works well with with 6 integers digits, example: \num{62034.023458763e23} but not with 5. Try \num{6203.023458763e23}. Is it a bug? Commented Dec 6, 2017 at 12:38
  • 2
    @cbe-user-99263: No, it is no bug, it is by - design. sunitx does not group digits fewer than 5 by default -- if this not wanted, use `group-minimum-digits=4, for example, as the updated example Commented Dec 6, 2017 at 22:54

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.