Skip to content

Commit

Permalink
Roundoff file size
Browse files Browse the repository at this point in the history
  • Loading branch information
henry2004y committed Dec 5, 2024
1 parent ac34371 commit 62897ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,15 @@ end
function Base.show(io::IO, data::BATS)
showhead(io, data)
if data.list.bytes 1e9
println(io, "filesize: $(data.list.bytes/1e9) GB")
str = @sprintf "filesize: %.1f GB" data.list.bytes/1e9
elseif data.list.bytes 1e6
println(io, "filesize: $(data.list.bytes/1e6) MB")
str = @sprintf "filesize: %.1f MB" data.list.bytes/1e6
elseif data.list.bytes 1e3
println(io, "filesize: $(data.list.bytes/1e3) KB")
str = @sprintf "filesize: %.1f KB" data.list.bytes/1e3
else
println(io, "filesize: $(data.list.bytes) bytes")
str = @sprintf "filesize: %.1f Bytes" data.list.bytes
end
println(io, str)
println(io, "snapshots: $(data.list.npictinfiles)")
end

Expand Down

0 comments on commit 62897ff

Please sign in to comment.