siestacat / bytes-to-human-readable
Bytes to human readable
1.0.1
2023-11-30 20:01 UTC
Requires
- php: >=8.0
- ext-bcmath: *
Requires (Dev)
- phpunit/phpunit: ^10.2.2
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