Learn R Programming

RITCH (version 0.1.26)

format_bytes: Formats a number of bytes

Description

Formats a number of bytes

Usage

format_bytes(x, digits = 2, unit_suffix = "B", base = 1000)

Value

the values as a character

Arguments

x

the values

digits

the number of digits to display, default value is 2

unit_suffix

the unit suffix, default value is 'B' (for bytes), useful is also 'B/s' if you have read/write speeds

base

the base for kilo, mega, ... definition, default is 1000

Examples

Run this code
format_bytes(1234)
format_bytes(1234567890)
format_bytes(123456789012, unit_suffix = "iB", base = 1024)

Run the code above in your browser using DataLab