siestacat/bytes-to-human-readable

Bytes to human readable

Installs: 70

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/siestacat/bytes-to-human-readable

1.0.1 2023-11-30 20:01 UTC

This package is auto-updated.

Last update: 2025-09-29 03:14:25 UTC


README

Install:

composer require siestacat/bytes-to-human-readable

Usage:

use Siestacat\BytesToHumanReadable\BytesToHumanReadable;

var_dump(BytesToHumanReadable::convert(1104)); //1.10 kB
var_dump(BytesToHumanReadable::convert(67229, true, 1)); //65.6 KiB

Tests:

git clone https://github.com/SiestaCat/php-bytes-to-human-readable.git
cd php-bytes-to-human-readable
composer install
composer run-script test

Credits

https://stackoverflow.com/a/2510455