TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I right align the following two columns, just specifying that there will be at most 5 integer digits and never any decimals? I can't seem to get the right combination of options. I can align it properly, but I lose all the commas for some reason.



S[table-format = 5.0,group-digits=true,group-separator={,},table-number-alignment = right,input-ignore={,},input-decimal-markers={.},group-digits=true,group-separator={\,}]
S[table-format = 5.0,group-separator={,},table-number-alignment = right,input-ignore={,},input-decimal-markers={.},group-digits=true,group-separator={\,}]
siunitx: &\num{19000}                &\num{19,000} \\
siunitx: &\num{7,000}                &\num{7,000} \\
siunitx: &\num{900}                &\num{900} \\
siunitx: &\num{90}                &\num{90} \\
share|improve this question
up vote 7 down vote accepted

You are using \num inside an S column: that's not how it works. The column contents are parsed 'directly':


  input-decimal-markers = .,input-ignore = {,},table-number-alignment = right,
  group-separator={,}, group-four-digits = true

  rS[table-format = 5.0]S[table-format = 5.0]
siunitx: &19000                &19,000 \\
siunitx: &7,000                &7,000 \\
siunitx: &900                  &900 \\
siunitx: &90                   &90 \\
share|improve this answer
The alignment is fine, but the commas are still missing. I need them in the output. How can I put them back after using input-ignore={,}? If I add a group-separator = {,} it doesn't put a comma after the 7 in 7000, only after the 19 in 19000! – user2146441 May 19 '14 at 15:46
@user2146441 They have nothing to do with those in the input: I've added the appropriate options – Joseph Wright May 19 '14 at 15:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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