Skip to content

Repository files navigation

HumanReadableBytes

Build Lint Test

A library providing the famous "human readable bytes" StackOverflow answer.

Installation

Stable Preview

implementation "cl.emilym:bytes:<latest>"

Usage

long fileSize = 10_000;
// Prints "The size of the file is 10kB"
System.out.println("The size of the file is " + HumanReadableBytes.si(fileSize));
// Prints "The size of the file is 9.8KiB"
System.out.println("The size of the file is " + HumanReadableBytes.bi(fileSize));

About

Output a byte count in a human readable format, supporting both SI and IEC units.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages