[Tex/LaTex] Table with Tabu & siunitx not working

siunitxtabu

I am trying to make a table with tabu and using the sunitx package to align and round the entries of my table. However I keep getting the following error:

! siunitx error: "unknown-option" ! ! Unknown option 'm'. ! ! See the
siunitx documentation for further information.

My MNWE (minimal not-working example)

\documentclass[a4paper]{scrreprt}             
\usepackage{siunitx,booktabs}
\usepackage{tabu}
\usepackage[]{xcolor}

\begin{document}
\newcolumntype Z{ XS[m,
 tight-spacing=true,round-mode=places,
                          round-precision=2] }
\begin{table} 
\centering 
\small
\caption{Caption}\label{tab:exAll}
\begin{tabu}{X[m,l] ZZZZZZZZ}  
\toprule
{}&{A}&{B}&{C}&{D}&{E}&{F}&{G}&{H}\\
\midrule
case 1&0.038941&    10.793553&  10.793553&  2.660292&   5.364928&   0.287945&   4.950661&   1.017396\\
case 2&0.051109&    10.416524&10.416524&    2.699890&5.236410&  0.348350&   5.528117&   0.835394\\
case 3&0.042755&    11.165675&11.165675&    2.845072&   6.585281&   0.279750&   5.059948&   0.920121\\
case 4&0.043165&    10.820561   &10.820561& 2.708484&   5.250033&   0.291793&   4.661221&   0.879731\\
case 5&0.042951&13.764616&13.764616&    2.643305&   5.608317&   0.278537&   5.080898&   0.871181\\
case 6&0.042078&    10.909180   &10.909180& 2.568346&   5.198260&   0.311224&   4.724302&   0.862366\\
\bottomrule
\end{tabu}
\end{table}

\end{document}

How can I solve this problem?
I looked at similar questions here on tex.se but those didn't help me. I hope I am not overlooking something very simple.

Best Answer

Change your new column definition to

\newcolumntype{Z}{S[
 tight-spacing=true,round-mode=places,
                          round-precision=2] }

Full code:

\documentclass[a4paper]{scrreprt}
\usepackage{siunitx,booktabs}
\usepackage{tabu}
\usepackage[]{xcolor}

\begin{document}
\newcolumntype{Z}{S[
 tight-spacing=true,round-mode=places,
                          round-precision=2] }
\begin{table}
\centering
\small
\caption{Caption}\label{tab:exAll}
\begin{tabu}{X[m,l] ZZZZZZZZ}
\toprule
{}&{A}&{B}&{C}&{D}&{E}&{F}&{G}&{H}\\
\midrule
case 1&0.038941&    10.793553&  10.793553&  2.660292&   5.364928&   0.287945&   4.950661&   1.017396\\
case 2&0.051109&    10.416524&10.416524&    2.699890&5.236410&  0.348350&   5.528117&   0.835394\\
case 3&0.042755&    11.165675&11.165675&    2.845072&   6.585281&   0.279750&   5.059948&   0.920121\\
case 4&0.043165&    10.820561   &10.820561& 2.708484&   5.250033&   0.291793&   4.661221&   0.879731\\
case 5&0.042951&13.764616&13.764616&    2.643305&   5.608317&   0.278537&   5.080898&   0.871181\\
case 6&0.042078&    10.909180   &10.909180& 2.568346&   5.198260&   0.311224&   4.724302&   0.862366\\
\bottomrule
\end{tabu}
\end{table}

\end{document}

enter image description here

With round-precision=3, you get

enter image description here