I would like to display numbers like 9.0001
and 10.0001
in the fixed-width form of xx.xxxx
. This seems like a perfect job for:
NumberForm[#, {6, 4}, NumberPadding -> {"0", "0"}] & /@ {9.0001, 10.0001}
But this returns {009.0001, 010.0001}
, which has one extra leading zero.
Reducing the number of digits doesn't fix this.
NumberForm[#, {5, 4}, NumberPadding -> {"0", "0"}] & /@ {9.0001, 10.0001}
{09.0001,010.0000}
Why is at least one copy of the left NumberPadding always being added, even when this makes the total number of digits exceed n
, the desired total number of digits?