Closed Jollywatt closed 9 months ago
It looks like this behaviour might be intentional since metro distinguishes between #num(minimum-decimal-digits: 2)[42]
and #num(minimum-decimal-digits: 2)[42.]
. If so, regard this as a feature request! The problem still arises if your number is stored as data (a float
).
Yes this is a bug but it seems to be fixed with the current dev version. I should be making a release soon!
It seems that
#num(42.0, minimum-decimal-digits: 2)
doesn't work as expected, rendering as $42$ instead of $42.00$.As a side note, and I realise this might be deliberate for consistency with
siunitx
, but it would be great to have an optiondecimal-digits
as well asminimum-decimal-digits
, which behaves like thesprintf
format%.*f
. As it stands, I can't figure out how to format an arbitrary number to an exact number of decimal places without usingoxifmt
(e.g.,#num(strfmt("{:.2}", 42))
) -- but it seems a bit silly to load both packages for this!