Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using the siunitx package

\usepackage{siunitx}

Consider the following two tables:

1.

\begin{tabular}{
  S[table-number-alignment=center, table-figures-decimal=3, table-auto-round]
}
  3.23958398 \\
\end{tabular}

% => 3.234

2.

\begin{tabular}{
  S[table-figures-decimal=3, table-auto-round]
}
  3.23958398 \\
\end{tabular}

% => 3.23958398

In the former, the number gets rounded, but in the latter it does not. Ran under both pdflatex and xelatex. Can anyone explain?

share|improve this question

1 Answer 1

up vote 9 down vote accepted

In the second case, you have not set the table-number-alignment key, which will therefore take the default value center-decimal-marker. The later does not reserve space in the table for numbers of a particular size, and so table-auto-round does not apply.

The entire reason that center-decimal-marker is the default is precisely because it does not require any information about the size of the number in order to carry out alignment without any overfull boxes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.