Julia: Printf %g behaves strangely with 0 precision.

Created on 11 Dec 2015  路  2Comments  路  Source: JuliaLang/julia

Discovered during #14331.

Namely these cases.

julia> @sprintf("%#.0g", 42)
"4.200000e+01"
c-> "4.e+01"

julia> @sprintf("%.0g", 42)
"4.2e+01"
c-> "4e+01"

julia> @sprintf("%.0g", 42.3)
"4.23e+01"
c-> "4e+01"

I'll be happy to take it.

bug display and printing help wanted

Most helpful comment

All 2 comments

Please do! I'll act as backstop if you don't get around to it.

Was this page helpful?
0 / 5 - 0 ratings