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 5ea75a8 commit 740ed2eCopy full SHA for 740ed2e
R/format.R
@@ -34,11 +34,12 @@ is_vector_s3.blob <- function(x) TRUE
34
blob_size <- function(x, digits = 3, trim = TRUE, ...) {
35
x <- vapply(x, length, numeric(1))
36
37
- power <- min(floor(log(abs(x), 1000)), 4)
+ units <- c("kb", "Mb", "Gb", "Tb")
38
+ power <- min(floor(log(abs(x), 1000)), length(units))
39
if (power < 1) {
40
unit <- "B"
41
} else {
- unit <- c("kb", "Mb", "Gb", "Tb")[[power]]
42
+ unit <- units[[power]]
43
x <- x / (1024 ^ power)
44
}
45
0 commit comments