I want to round numbers to hundreds. I note Rounding a number to its hundred. However, the question asks about rounding 2,386.0 down to 2,300.0 -- and I would want it to be rounded up to 2,400.0, and I would want 2,326.0 to be rounded down to 2,300.0.
How to do this?
According to a comment by joseph-wright, it would be easy, but after reading and trying for an hour, I decided to ask here.
MWE
\documentclass{article}
\usepackage{xparse,siunitx}
\ExplSyntaxOn
\NewDocumentCommand{\hundreds}{O{}m}
{
\num[#1]{\fp_eval:n { trunc(#2,-2) }}
}
\ExplSyntaxOff
\newcommand{\myhundreds}[1]{\num[round-mode=figures,round-precision=-2]{#1}}
\begin{document}
\hundreds{2348}
\hundreds[group-four-digits,group-separator={,}]{2348}
\sisetup{group-four-digits,group-separator={,}}
\hundreds{2399}
\hundreds{2301}
\myhundreds{2300}
\end{document}

