Skip to content

Commit 14171de

Browse files
committed
Update calls to round, change signif to round
1 parent 016d84a commit 14171de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fmtcore.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ end
171171

172172
function _pfmt_f(out::IO, fs::FormatSpec, x::AbstractFloat)
173173
# separate sign, integer, and decimal part
174-
rax = round(abs(x), fs.prec)
174+
rax = round(abs(x); digits=fs.prec)
175175
sch = _signchar(x, fs.sign)
176176
intv = trunc(Integer, rax)
177177
decv = rax - intv
@@ -226,7 +226,7 @@ function _pfmt_e(out::IO, fs::FormatSpec, x::AbstractFloat)
226226
e = 0
227227
u = zero(x)
228228
else
229-
rax = signif(ax, fs.prec + 1)
229+
rax = round(ax; sigdigits = fs.prec + 1)
230230
e = floor(Integer, log10(rax)) # exponent
231231
u = rax * exp10(-e) # significand
232232
end

0 commit comments

Comments
 (0)