11

What is the proposed way to set numbers in tables which are all in the millions? None of the numbers has a significant digit smaller than 1,000. Since it is a rather large table, I want to get rid off all those ,000 trailing each number.

\documentclass{article}

\usepackage{booktabs}

\begin{document}
\begin{tabular}{lrrrr}
    \toprule
    Category & Col A & Col B &  Col C & \dots\\ 
    \midrule
    Line 1 & 18,855,000 & 13,870,000 & 1,235,000 & \dots\\
    \addlinespace
    Line 2\\
    \quad Item 2--1 & 10,280,000 & 7,519,000 & 650,000 & \dots\\
    \quad Item 2--2 & 8,575,000 & 6,351,000 & 585,000 & \dots\\
    \dots\\
    \bottomrule
\end{tabular}

\end{document}

enter image description here

David Carlisle
  • 757,742
DerMike
  • 213

2 Answers2

8

Edit: I just saw that you are from Germany. In this case a "," as group seperator is not such a good idea as it might be confused with decimal seperators. I'll use a simple small space then.

\documentclass{article}

\usepackage{siunitx}
\usepackage{booktabs}

\begin{document}

\begin{tabular}{
    l
    *{3}{S[fixed-exponent = 3,
           round-precision = 3,
           round-mode=figures,
           group-minimum-digits = 4,
           group-separator = {\,},
           table-omit-exponent, 
           table-format = 5.0]}
    r}
    \toprule
    Category & Col A / \num{e3} & Col B / \num{e3} &  Col C / \num{e3} & \dots\\ 
    \midrule
    Line 1 & 18855000 & 13870000 & 1235000 & \dots\\
    \addlinespace
    Line 2\\
    \quad Item 2--1 & 10280000 & 7519000 & 650000 & \dots\\
    \quad Item 2--2 & 8575000 & 6351000 & 585000 & \dots\\
    \dots\\
    \bottomrule
\end{tabular}

\end{document}

enter image description here

David Carlisle
  • 757,742
Philipp
  • 3,815
  • 1
    I've also seen the form "×10^3" instead (occasionally in brackets) to highlight the fact that the actual quantity (ColA) is in thousands. But I guess this is very variable. – Thomas Aug 27 '13 at 02:22
  • @Thomas I'm not sure what's the convention (if there is any). Units are often put into brackets but I've also seen them put into a column title the way I did it. But for mere numerical factors I would agree with you that the "×10^3" form might indeed be best. – Philipp Aug 27 '13 at 02:35
  • Like for units, you should than use "in" or at least round brackets. I've seen (and used...) the \times 10^3 version a lot, but actually that would say: \text{ColA}_\text{Line1} \times 10^3 = 18900 which is wrong. I think Phillip's approach is just fine as it is. – LaRiFaRi Aug 27 '13 at 10:16
6

Or maybe like this?

\documentclass{article}
\usepackage[%
    %,locale=DE % if you write in Germany, switch that on for comma decimal seperators
]{siunitx}
%\sisetup{input-decimal-markers = ., input-ignore = {,}} % if your input looks like in your MWE
\usepackage{booktabs}

\begin{document}

\begin{table}
\caption{Amounts in millions}
\centering
\begin{tabular}{%
    l
    S[fixed-exponent = 6, table-omit-exponent,table-format = 2.3, table-auto-round]
    S[fixed-exponent = 6, table-omit-exponent,table-format = 2.3, table-auto-round]
    S[fixed-exponent = 6, table-omit-exponent,table-format = 1.3, table-auto-round]
    r
    }
    \toprule
    Category & {Col A} & {Col B} &  {Col C} & \dots\\ 
    \midrule
    Line 1 & 18855000 & 13870000 & 1235000 & \dots\\
    \addlinespace
    Line 2\\
    \quad Item 2--1 & 10280000 & 7519000 & 650000 & \dots\\
    \quad Item 2--2 & 8575000 & 6351000 & 585000 & \dots\\
    \dots\\
    \bottomrule
\end{tabular}
\end{table}

\end{document}

enter image description here

Edit

DIN 55301 - "Gestaltung statistischer Tabellen" recommends to use the caption (title) for the appearance of "millions". For single columns, they use e.g. "Col A in millions" or for just a unit "Mill. [Col A]" or "M[Col A]"*. The example for our case of all occurring values says: "Table 1: Amounts in 1000000"

*[X] means: unit of X

David Carlisle
  • 757,742
LaRiFaRi
  • 43,807
  • This will be language-dependent: in English 'Mio' doesn't read naturally as 'millions' – Joseph Wright Aug 26 '13 at 20:37
  • OK, I have edited my example. The abbreviation for "millions" in English doesn't seem to be a clear thing. In German it would be "Mio." – LaRiFaRi Aug 27 '13 at 10:58