# returns "934.82 MB"
formatBytes(934818582)
# returns "891.51 MiB"
formatIECBytes(934818582)
# returns c("8.43 KB", "3.52 KB", "624.62 KB", "46", "7.36 KB")
formatBytes(c(8429, 3525, 624624, 46, 7357))
Run the code above in your browser using DataLab