[Tex/LaTex] Numbers in tables: align by decimal point *and* flush right

horizontal alignmentpunctuationsiunitxtables

This is a followup question to siunitx: aligning numbers by decimal points in tables doesn't work for bolded or italicized numbers
and Aligning numbers by decimal points in table columns.

While the solutions to both questions worked, there is a final change I hope it is possible. Currently, while the numbers are aligned by decimal points, they are centered within the column. Below is the code and its output.

Is there a way to make the numbers in the rightmost column be flushed right as well, while maintaining the alignment by decimal point? It is alright if a little bit of help is needed, such as declaring in advance how many digits are in each part (integer and fractional). Thus it is known which decimal position will be the rightmost one and the alignment can be determined.

\begin{table}[htp]
    \centering
    \begin{tabular}{@{}l r r>{\bfseries}S[table-format=3.2]@{}}
          \toprule
          \textbf{Product Group} & \textbf{Production Size} & \textbf{Number of Failures} & \textbf{Failure Rates} \\
          & & & \textbf{(per 1,000 items)} \\
          \midrule
          %  \addlinespace
          foo1 & 11,111 & 1,111 & 11.11\\
          foo2 & 22,222 & 2,222 & 222\\
          foo3 & 33,333 & 3,333 & 3.33\\
          foo4 & 44,444 & 4,444 & 44.4\\
          foo5 & 55,555 & 5,555 & 5.5\\
          \bottomrule
    \end{tabular}
\end{table}

alt text

Best Answer

Use the following as your column format:

S[table-format=3.2,table-number-alignment=right]