Aligning numeric data

Standard alignment options in table columns are left, right, and centered. In cases of numeric values, this might not be sufficient. The only way to keep number magnitudes comparable is aligning digits at certain positions, such as at the ones, thousands, or millions places, or at decimal points. Integers can simply be right aligned. Numbers with decimal fractions could be filled up with zeroes to get decimal points aligned, but that would add vacuous noise.

In the case of fractions, it's good to directly align at the decimal points. In this recipe, we will implement this.

How to do it...

The siunitx package is, first of all, intended for typesetting values with units consistently. Incidentally, supporting its primary purpose, ...

Get LaTeX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.