# Ryan's Blog

## Aligning on decimal points: an example of the @ specifier

Posted in latex by ryanlayer on October 5, 2009

In scientific tables it is often desirable to align the columns on a decimal point. This can be done using the @ col specifier and breaking the number into the integral part in a right-justified column and the fractional part in a left-justified column:

  The following input:          will display as:

\begin{tabular}{r@{.}l}
3&14159\                         3.14159
16&2\                           16.2
123\$456\ \end{tabular}         123.456


Note that the decimal point is replaced by the column separator, & and that the @suppresses the intercolumn space

Tagged with: ,

### 4 Responses

1. Stefan Kottwitz said, on October 7, 2009 at 9:26 pm

There are useful packages regarding aligned decimal numbers in tables, dcolumn and rccol.

Stefan

• ryanlayer said, on October 8, 2009 at 7:25 am

Thanks Stefan, do you have a link?

2. Stefan Kottwitz said, on October 8, 2009 at 9:13 am

Yes, here are links to those packages on CTAN:

3. […] the number into two columns (integer and fractional parts), as documented here or here. The LaTeX code is simple, but the approach is a pain when it comes to copying and pasting […]