I am trying to align values in multiple columns of a table.
There is a column with very large numbers and decimals, there is one with commas and no comma at all by intention, there is another one with a unit involved (%), if it plays a role, and one with very large numbers and no decimals. Finally, there is also a mixed one, where the dot should be aligned to the comma (optional, I believe this is hard!).
Can this be done with siunitx
? I played around with the options, but mostly I get errors which I don't know how to debug. Any hint appreciated. I am fine with a solution for column 2 to column 5 really; column 6 (mixed) is really optional. I just added it because I am curious if it is possible.
edit based on the comments: If only part of my request is possible in siunitx, that would be very helpful as well. Thanks!
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\begin{tabular}{lccccc}
row & alignToDec & alignToComma & alignWithUnit & AlignLargeNumbers & alignMixedOptional \\
row1: & 19,000,000.0 & 19,000 & 12.31\% & 12,222,222 & 12.31 \\
row2: & 7,000,434.12 & 7,000 & 11.31\% & 13,222,222 & 12,31 \\
row3: & 900,342.12 & 900 & 10.98\% & 142,222,222 & 12.31 \\
row4: & 90.0 & 90 & 12.21\% & 1,531,222,222 & 12,31 \\
\end{tabular}
\end{document}
\end{document}
S
column type (instead ofc
) along with the setup in the preamble:\sisetup{ input-ignore={,}, input-decimal-markers={.}, group-separator={,}, group-minimum-digits=4, }
. – Peter Grill Oct 23 '18 at 7:10,
(comma) and.
(dot) as the input decimal marker symbol? Please clarify. – Mico Oct 23 '18 at 7:37,
(comma) and.
(dot) as the input decimal marker symbol? And, in the second data column, is,
acting as the input decimal marker, so that19,000
is equal to19
? Please clarify. – Mico Oct 23 '18 at 7:45