[Tex/LaTex] Aligning Decimal Points in Table

horizontal alignmentpunctuationtablestabularx

I want to align two numbers in two different rows the decimal point.

I do see a link for that here:
Aligning numbers by decimal points in table columns

However, I don't understand how to incorporate that into my code. What follows is a reduced version of my code.

\documentclass[12pt,english]{article}
\usepackage{longtable}
\usepackage{fullpage}
\usepackage{times}
\usepackage[flushleft]{threeparttable}
\usepackage[font=large,labelfont=bf,tableposition=top,textfont=bf]{caption}
\usepackage{tabularx}
\usepackage{booktabs}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\begin{document}

\clearpage \newpage
\begin{table}[!ht]
\caption{Table Title}
\def\arraystretch{1.05}
\vspace{-0.2cm}
\begin{threeparttable}
\small
\begin{tabularx}{\textwidth}{l*{10}{C}}
\hline \hline \addlinespace
& (1)  \\  
Variable Name & 0.1234566  \\
& (0.1234566) \\
\hline \hline \addlinespace
 \end{tabularx}
\begin{tablenotes}
\vspace{0.1cm}
\footnotesize{

\item \noindent \hspace{-1.8mm} Notes: 

 \noindent Sources: 
 }
\end{tablenotes}
\end{threeparttable}
\end{table}

\end{document}

Best Answer

In addition to trying out the dcolumn package mentioned by @DavidCarlisle, you may also want to check out some of the capabilities of the siunitx package, specifically, its S column type. I've simplified your (not exactly minimal) working example to the example code below, in order to focus on the operation of this column type:

\documentclass[12pt]{article}
\usepackage{booktabs,mathptmx,siunitx}
\sisetup{input-symbols = {()},  % do not treat "(" and ")" in any special way
         group-digits  = false} % no grouping of digits
\begin{document}
\begin{table}
  \begin{tabular}{@{}l S[table-format=2.7] S[table-format=4.2] @{}}
    \toprule
    & \multicolumn{1}{c}{(1)} & \multicolumn{1}{c@{}}{(2)}  \\  
    \midrule
    Variable Name & 98.1234567 & 1234.56  \\
    & (0.6789) & (54.3)\\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}

enter image description here

Related Question