Description Usage Arguments Value Examples
Use pretty_bytes()
to format bytes. compute_bytes()
is the underlying
engine that may be useful for custom formatting.
1 2 3 | pretty_bytes(bytes, style = c("default", "nopad", "6"))
compute_bytes(bytes, smallest_unit = "B")
|
bytes |
Numeric vector, number of bytes. |
style |
Formatting style:
|
smallest_unit |
A character scalar, the smallest unit to use. |
Character vector, the formatted sizes.
For compute_bytes
, a data frame with columns amount
, unit
,
negative
.
1 2 3 4 | bytes <- c(1337, 133337, 13333337, 1333333337, 133333333337)
pretty_bytes(bytes)
pretty_bytes(bytes, style = "nopad")
pretty_bytes(bytes, style = "6")
|
[1] " 1.34 kB" "133.34 kB" " 13.33 MB" " 1.33 GB" "133.33 GB"
[1] "1.34 kB" "133.34 kB" "13.33 MB" "1.33 GB" "133.33 GB"
[1] "1.3 kB" "133 kB" " 13 MB" "1.3 GB" "133 GB"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.