5

Remove "0" before decimal number in Tables using "siunitx" package, please refer highlighted portions for your references and my MWE file as below:

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}
\centering
\begin{tabular}{@{}S[table-format=1.2,group-four-digits=false,
round-integer-to-decimal=false,]
              *{4}{S[table-format=2.2]}
              *{2}{S[table-format=3.2]}@{}}
\toprule
$\varphi$ & a & $\xi$ & $\alpha$ & $\beta$ & ${\dot{W}}^{M1}$ & ${\dot{W}}^{M2}$ \\
\midrule
{Abcde} & .00 & .48 &  .02 &  .17 & 250.00 & 250.00 \\
.10 & .50 & .21 & .82 & .39 & 236.86 & 236.72000 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}

enter image description here

1
  • This is a good question for understanding how to use siunitx, but I suggest keeping the leading zero for most uses. It's really easy to lose the leading decimal due to a bad print job/photocopy/scan, or for it to be overlooked even in a good one. At a cost of one character's width, the added zero makes the value more clear. The only time the zero isn't useful is when the type of value is known to be less than one (as is sometimes the case for statistics) and values are printed in tabular form (as is done here).
    – jvriesem
    Commented Dec 7, 2021 at 22:29

1 Answer 1

5

With the help of add-integer-zero=false and a correcter table-format of the last column:

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage{siunitx}
\begin{document}
\begin{table}
\centering
\sisetup{add-integer-zero=false}
\begin{tabular}{@{}S[table-format=1.2]
              *{4}{S[table-format=2.2]}
              S[table-format=3.2]
              S[table-format=3.5]@{}}
\toprule
$\varphi$ & a & $\xi$ & $\alpha$ & $\beta$ & ${\dot{W}}^{M1}$ & ${\dot{W}}^{M2}$ \\
\midrule
{Abcde} & .00 & .48 &  .02 &  .17 & 250.00 & 250.00 \\
.10 & .50 & .21 & .82 & .39 & 236.86 & 236.72000 \\
\bottomrule
\end{tabular}
\end{table}
\end{document}
4
  • 1
    Thank you Leandriis, which is I am looking for.
    – Rajesh N
    Commented Oct 21, 2019 at 11:54
  • You could also adjust the column format to reflect that there is no longer an integer portion (table-format=0.2) if centered headings are desired.
    – Scott H.
    Commented Oct 21, 2019 at 14:56
  • 2
    The add-integer-zero option is dropped from the latest releases. Is there any replacement for it? I tried minimum-integer-digits = 0 but this doesn't seem to do it.
    – Bob
    Commented Jan 24, 2022 at 20:28
  • For me the following did work: print-zero-integer = false.
    – majom
    Commented Mar 23, 2023 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .