format_bytes: Format numbers of bytes using a specified unit

Description Usage Arguments Value Examples

View source: R/utils.R

Description

Call the S3 method format.object_size() to format numbers of bytes.

Usage

1
format_bytes(x, units = "auto", ...)

Arguments

x

A numeric vector (each element represents a number of bytes).

units, ...

Passed to format().

Value

A character vector.

Examples

1
2
xfun::format_bytes(c(1, 1024, 2000, 1e+06, 2e+08))
xfun::format_bytes(c(1, 1024, 2000, 1e+06, 2e+08), units = "KB")

xfun documentation built on June 16, 2021, 1:07 a.m.