Closed
Description
openedon Jun 17, 2016
Is this behavior incorrect in the second case below?
julia> @printf "|%8.2g|" 0.0000312
| 3.1e-05|
julia> @printf "|%8.2g|" 0.00003
| 3e-05|
In the second case, only 6 characters are printed between the bars, yet I specified with %8 that a minimum of 8 chars should be printed.
One option is to pad the extra spaces before 3. Otherwise, print a decimal and zero after 3, which is the same (correct) behavior as:
julia> @printf "|%#8.2g|" 0.00003
| 3.0e-05|
Bumping #10610, Julia might benefit from rethinking print formatting.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment