[Tex/LaTex] Comma format error (siunitx)

siunitx

enter image description here

Why is the comma missing in the rendering of 1,089 ?

MWE:

\documentclass{article}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{siunitx}
\sisetup{input-ignore={,},input-decimal-markers={.},group-separator={,}}

\begin{document}

{\renewcommand{\arraystretch}{1.2}% for the vertical padding
\begin{tabular}{|cc
|
S[table-format=3.0]
S[table-format=5.0]
|
S[table-format=6.0]
|
}
\hline
& &   \multicolumn{2}{c|}{suffers from X} & \\
& &    {yes} & {no} & {total} \\
\hline
\multirow{2}{*}{test + for X}
     & yes &  90  & 999  & 1,089 \\
     & no  &  10  & 98,901 & 98,911 \\
\hline
 & total & 100  & 99,900  & 100,000 \\
\hline
\end{tabular}
}

\end{document}

Best Answer

The default for group-minimum-digits is 5, the integer 1089 has 4 digits only.

\documentclass{article}

\usepackage{booktabs}
\usepackage{multirow}
\usepackage{siunitx}
\sisetup{
  input-ignore={,},
  input-decimal-markers={.},
  group-separator={,},
  group-minimum-digits=4,
}

\begin{document}

{\renewcommand{\arraystretch}{1.2}% for the vertical padding
\begin{tabular}{|cc
|
S[table-format=3.0]
S[table-format=5.0]
|
S[table-format=6.0]
|
}
\hline
& &   \multicolumn{2}{c|}{suffers from X} & \\
& &    {yes} & {no} & {total} \\
\hline
\multirow{2}{*}{test + for X}
     & yes &  90  & 999  & 1,089 \\
     & no  &  10  & 98,901 & 98,911 \\
\hline
 & total & 100  & 99,900  & 100,000 \\
\hline
\end{tabular}% remove unwanted space by line end
}
\end{document}

Result