Go to file
Anton Smirnov c1ccdc14e4 .gitattributes 2023-02-22 20:37:54 +02:00
docs Docs and license 2023-02-22 20:06:35 +02:00
src Docs and license 2023-02-22 20:06:35 +02:00
.gitattributes .gitattributes 2023-02-22 20:37:54 +02:00
.gitignore Fix scale being ignored 2023-02-22 19:51:11 +02:00
LICENSE.md Docs and license 2023-02-22 20:06:35 +02:00
README.md Docs and license 2023-02-22 20:06:35 +02:00
composer.json Add type 2023-02-22 20:20:04 +02:00
phpcs.xml Code style 2023-02-22 19:45:27 +02:00

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.