Skip to content

Commit 328a9e3

Browse files
oxinaboxquinnj
authored andcommittedSep 26, 2018
=make download progress safer (#316)
1 parent 7d41647 commit 328a9e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/download.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ from the rules of the HTTP.
8989
- any additional keyword args (`kw...`) are passed on to the HTTP request.
9090
"""
9191
function download(url::AbstractString, local_path=nothing, headers=Header[]; update_period=1, kw...)
92-
format_progress(x) = "$(round(100x, digits=2))%"
93-
format_bytes(x) = x==Inf ? "∞ B" : Base.format_bytes(x)
92+
format_progress(x) = round(x, digits=4)
93+
format_bytes(x) = !isfinite(x) ? "∞ B" : Base.format_bytes(x)
9494
format_seconds(x) = "$(round(x; digits=2)) s"
9595
format_bytes_per_second(x) = format_bytes(x) * "/s"
9696

0 commit comments

Comments
 (0)
Please sign in to comment.