# siunitx S column does not align numbers without dot

I have a table that uses the S column type provided by siunitx. Unfortunately, if a number does not have a . it is not aligned properly. Yes, i could write number. but then the table will list the entry as number.0 instead of just number.

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}

\begin{table} \centering
{\small
\begin{tabular}{SS}
\toprule
{x}   &{x}   \\
\midrule
123 & 23.0e-5  \\
123.0 & 23\\
0.23 & 1.423  \\
0.23 & 1  \\
\bottomrule
\end{tabular}}
\end{table}

\end{document}


-
You need to tell siunitx the table-format (at least with parse-numbers = true, the standard setting). – Joseph Wright Dec 2 '12 at 16:52
@cmhughes Dang. :) Queuing here apparently. – percusse Dec 2 '12 at 16:57
I think for a table like this it is a good idea to have the sample decimals for each number, so 23.000, 1.000, 0.230 etc. – Jörg Dec 2 '12 at 18:36

Here's a solution that specifies the table-format for each column; note that I also grouped {23e-5}

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}

\begin{table} \centering
{\small
\begin{tabular}{S[table-format=3.2]S[table-format=2.3]}
\toprule
{x}   &{x}   \\
\midrule
123 & {23.0e-5}  \\
123.0 & 23\\
0.23 & 1.423  \\
0.23 & 1  \\
\bottomrule
\end{tabular}}
\end{table}

\end{document}

-
table-format works with exponents, too. For example S[table-format=2.1e-1] (close \times, overfull hbox for 1.423) or S[table-format=2.3e-1]. – Qrrbrbirlbel Dec 2 '12 at 17:23
Works like a charm together with @Qrrbrbirlbel information! – bioslime Dec 2 '12 at 17:34
To explain why this is the case: the standard siunitx alignment strategy is different from that in dcolumn and is based around the idea that numbers will contain a decimal part. – Joseph Wright Dec 2 '12 at 17:35