You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Anton Smirnov c1ccdc14e4 .gitattributes 1 month ago
docs Docs and license 1 month ago
src Docs and license 1 month ago
.gitattributes .gitattributes 1 month ago
.gitignore Fix scale being ignored 1 month ago
LICENSE.md Docs and license 1 month ago
README.md Docs and license 1 month ago
composer.json Add type 1 month ago
phpcs.xml Code style 1 month ago

README.md

KiloMega

Packagist PHP Packagist

A metric formatter for PHP.

Installation

composer require 'arokettu/kilo-mega'

Documentation

Formatting a metric value

<?php
use function \Arokettu\KiloMega\format_metric;
echo format_metric(1000, suffix: 'W'); // 1.0 kW

Formatting a byte or bit value

<?php
use function \Arokettu\KiloMega\format_bytes;
echo format_bytes(1234); // 1.2 KiB

Support

Please file issues on our main repo at GitLab: https://gitlab.com/sandfox/kilo-mega/-/issues

Feel free to ask any questions in our room on Gitter: https://gitter.im/arokettu/community

License

The library is available as open source under the terms of the MIT License.