Is the following a bug in Printf?
julia> using Printf
julia> @sprintf "%8.3g" 1.99e-5
"1.99e-05"
julia> @sprintf "%8.3g" 1.999e-5
"2e-05"
I would expect the resulting string to be 8 characters long in both cases, while in the second it is only 5 characters long. It looks like @sprintf
is eating leading blanks.
For comparison, here’s the output from C’s printf
:
1.99e-05
2e-05
Should I submit a issue?