5

My problem is to round numbers that are integers so, for example, I have 123456789 but I only want to have 123 * 10^6 in the table cell.

example code:

\begin{table}
\caption{Table} \label{tab:tab}
\begin{center}
\begin{tabular}{l S}
\hline
 Name & {number} \\
\hline
 a & 18799382 \\
 b & 16492855 \\
\hline
\end{tabular}
\end{center}
\end{table}

I want to round the second column to have an output of something like:

\begin{table}
\caption{Table} \label{tab:tab}
\begin{center}
\begin{tabular}{l S}
\hline
 Name & {number} \\
\hline
 a & 188e5 \\
 b & 165e5 \\
\hline
\end{tabular}
\end{center}
\end{table}
mani
  • 53

1 Answers1

7

You need to do two things:

  • Turn on rounding with appropriate settings
  • Turn on fixed exponents with appropriate settings

Thus something like

\begin{tabular}
{
  l
  S[round-mode = figures,
   round-precision = 3,
   scientific-notation = fixed,
   fixed-exponent = 5]
}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036