Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a table with lots of raw numbers in the billions and hundreds of millions. I'd like to abbreviate the figures in these columns to millions. So instead of 234,091,123 as per the input, I'd like to display 234.09 without having to change the raw figures.

(I can then manually add the unit (m) to the column header.)

For example, I'd like to go automatically...

FROM:

\documentclass{standalone}
\usepackage[input-ignore={,},input-decimal-markers={.},group-separator={,}]{siunitx}
\begin{document}
\begin{tabular}{l S[table-format=9.0]}
\textbf{String} & \textbf{Number}\\
A & 123,456,789\\
B & 1,234,098\\
{...} & {...}\\
\end{tabular}
\end{document}

from

TO:

enter image description here

I might have overlooked something, but I didn't find anything in siunitx. Any ideas how this can be achieved?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

You can use the fact that siunitx has a setting to drop exponents in tables here:

\documentclass{standalone}
\usepackage{siunitx}
\sisetup{input-decimal-markers = ., input-ignore = {,}}
\begin{document}
\begin{tabular}
  {
    l
    S[fixed-exponent = 6, table-omit-exponent,table-format = 3.2, table-auto-round]
  }
\textbf{String} & \textbf{Number}\\
A & 123,456,789\\
B & 1,234,098\\
{...} & {...}\\
\end{tabular}
\end{document}

You have of course to make some decisions yourself!

share|improve this answer
    
Was thinking the exponent notation could be useful. :) Great, thanks again! –  badroit Jul 10 '12 at 21:14

Your Answer

 
discard

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.