We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 267dc28 commit 9ad7ab2Copy full SHA for 9ad7ab2
src/fmtcore.jl
@@ -333,7 +333,8 @@ end
333
334
function _pfmt_g(out::IO, fs::FormatSpec, x::AbstractFloat)
335
# Branch according to the exponent
336
- expnt = x == 0 ? 0 : floor(Int, log10(abs(x)) )
+ ax = round(abs(x) ;sigdigits=fs.prec)
337
+ expnt = ax == 0 ? 0 : floor(Int, log10(ax) )
338
if -4 <= expnt < fs.prec
339
newprec = fs.prec - expnt - 1
340
_pfmt_f(out, FormatSpec(fs ;prec=newprec), x)
0 commit comments