7

I'd like to use commas as the thousand separator, but siunitx is inserting a comma after the period that is used for decimal separation. Example:

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit\year{y}
\sisetup{group-separator = {,}}
\sisetup{group-minimum-digits = 3}

\begin{document}
     \SI{9000}[\$]{\per\tonne}
     
     \SI{0.1339}{\per\year}
\end{document}

Result:

$9,000 t-1

0.133,9 y-1

If I don't set the option group-minimum-digits to 3, I don't get 9,000. But it ends up displaying 0.133,9. Is there a way to fix this?

0
9

You want group-digits = integer

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit\year{y}
\sisetup{group-digits = integer, group-minimum-digits = 3, group-separator = {,}}

\begin{document}
     \SI{9000}[\$]{\per\tonne}

     \SI{0.1339}{\per\year}
\end{document}
3
  • And distinct group separators for the integral and the decimal part is not supported. It wouldn't make sense anyway.
    – egreg
    Sep 9 '16 at 15:25
  • @egreg To-date no-one has asked! I doubt it would make much sense :-)
    – Joseph Wright
    Sep 9 '16 at 15:33
  • 1
    Thank you very much! Wow... you helped me in less than a minute after I posted. I love this community! :)
    – Bruno
    Sep 9 '16 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.