I have a table with very long counts (in the millions), so I would like to add commas. I have tried to use siunitx in a variety of ways in the preamble:
\usepackage[group-separator={,}]{siunitx}\usepackage{siunitx} \sisetup{group-separator={,},group-minimum-digits={3},output-decimal-marker={.}}\sisetup{ group-digits=true, group-separator={\,}, } \pgfkeys{/pgf/number format/.cd, set thousands separator={\,}}%But none of these insert the commas. Could the problem be that I am using
longtable? When I specify \number{} around each table item, the commas are inserted, but there are too many tables to do this manually.
Here is an example:
\documentclass[12pt]{article}
\usepackage[group-separator={,}]{siunitx}
\usepackage{lscape,longtable}
\begin{document}
\begin{center}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{longtable}{l*{3}{cc}}
\hline\hline\endfirsthead\hline\endhead\hline\endfoot\endlastfoot
&\multicolumn{2}{c}{Managed Care}&\multicolumn{2}{c}{No Managed 1Care}&\multicolumn{2}{c}{Total}\\
& Count& \%& Count& \%& Count& \%\\
Adult & 7178237& 23.0& 6715828& 37.5& 13894065& 28.3\\
Aged & 1278137& 49.5& 3482900& 58.3& 4761037& 55.7\\
Child & 20562118& 60.9& 7015119& 29.4& 27577237& 47.8\\
\end{longtable}
}
\end{center}
\end{document}

\documentclass{...}and ending with\end{document}. – Joseph Wright Jun 27 '13 at 14:52