2

I am using the csvsimple package to create a table from a csv file. I am using the following options:

\csvreader[tabular=lllll,
           table head=\toprule Instance & Best & Worst & Mean & Standard Deviation\\ \midrule,
           head to column names,
           late after last line=\\\bottomrule]      
           {./../output/algorithms/as-results.csv}{}%
           {\instance & \best & \worst & \mean & \std}%

Now, I would like to apply a filter, only to the std column, to adjust the floating point precision. How can I do this?

1 Answer 1

2

One possibility would be to use the siunitx package.

\usepackage{siunitx}
\usepackage{booktabs}
\usepackage{csvsimple}

\begin{table}[htb]
    \sisetup{round-mode=places, round-precision=3}
    \centering
    \csvreader[tabular=lllll,
               table head=\toprule Instance & Best & Worst & Mean & Standard Deviation\\ \midrule,
               head to column names,
               late after last line=\\\bottomrule]
               {./../output/algorithms/as-results.csv}{}%
      {\instance & \num{\best} & \num{\worst} & \num{\mean} & \num{\std}}%
\end{table}
1
  • This will use the math font for numbers in the table. Is there a way to keep the original text font instead using this method?
    – smonsays
    Commented Sep 3, 2020 at 10:15

You must log in to answer this question.

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