![csvsimple 浮点精度过滤器](https://linux22.com/image/355368/csvsimple%20%E6%B5%AE%E7%82%B9%E7%B2%BE%E5%BA%A6%E8%BF%87%E6%BB%A4%E5%99%A8.png)
我正在使用该csvsimple
包从 csv 文件创建表格。我正在使用以下选项:
\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}%
现在,我想仅对列应用过滤器std
来调整浮点精度。我该怎么做?
答案1
一种可能性是使用该siunitx
包。
\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}