The table comes from the excellent answer of Philippe Goutet about this question :
\documentclass[a4paper,12pt]{article}
\usepackage{array,booktabs} % I add booktabs AM
\usepackage[hmargin=2cm]{geometry}
\usepackage{xcolor}
\makeatletter
%http://groups.google.com/group/comp.text.tex/msg/7e812e5d6e67fcc5
\def\convertto#1#2{\strip@pt\dimexpr #2*65536/\number\dimexpr 1#1}
\makeatother
\begin{document} %
\begin{center}\begin{tabular} % Philippe Goutet
{>{\def\colunit{pt}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{mm}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{cm}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{ex}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{em}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{bp}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{dd}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{pc}}l<{\convertto{\rowunit}{1\colunit}}
>{\def\colunit{in}}l<{\convertto{\rowunit}{1\colunit}}
>{\bfseries}l}
\multicolumn{1}{l}{\bfseries 1pt} & \multicolumn{1}{l}{\bfseries 1mm} &
\multicolumn{1}{l}{\bfseries 1cm} & \multicolumn{1}{l}{\bfseries 1ex} &
\multicolumn{1}{l}{\bfseries 1em} & \multicolumn{1}{l}{\bfseries 1bp} &
\multicolumn{1}{l}{\bfseries 1dd} & \multicolumn{1}{l}{\bfseries 1pc} &
\multicolumn{1}{l}{\bfseries 1in} & \\
\gdef\rowunit{pt} & & & & & & & & & \rowunit\\
\gdef\rowunit{mm} & & & & & & & & & \rowunit\\
\gdef\rowunit{cm} & & & & & & & & & \rowunit\\
\gdef\rowunit{ex} & & & & & & & & & \rowunit\\
\gdef\rowunit{em} & & & & & & & & & \rowunit\\
\gdef\rowunit{bp} & & & & & & & & & \rowunit\\
\gdef\rowunit{dd} & & & & & & & & & \rowunit\\
\gdef\rowunit{pc} & & & & & & & & & \rowunit\\
\gdef\rowunit{in} & & & & & & & & & \rowunit\\
\end{tabular}\end{center}
\end{document}
I would like to align the decimal separator in each column. I try with numprint and siunitx. I know the trick r@{.}l but here ... I'm waiting to see ...


dcolumnbut I was not able to use it, so thanks !! Is it possible withnumprintorsiunitx? – Alain Matthes Apr 22 '12 at 13:21d{.}{,}{2.5}instead ofd{.}{.}{2.5}in the definition of theZcolumn type. – egreg Apr 22 '12 at 15:201 234,567 89. With numprint, it's easy because with frenchb and babel it's automatic I need to use \newcolumntype{d}{n{2}{5}} but I have a problem with `{\convertto{\rowunit}{1#1}} – Alain Matthes Apr 22 '12 at 16:27tabular, exploiting the fact that\converttois expandable. So when TeX really sees the table to typeset the numbers are already there and have not to be computed. – egreg Apr 22 '12 at 22:06