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
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