arokettu / kilo-mega
A metric formatter for PHP
Installs: 168
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
pkg:composer/arokettu/kilo-mega
Requires
- php: ^8.0
Requires (Dev)
- phpunit/phpunit: ^9.6
- sandfox.dev/code-standard: ^1.2025.09.17
- squizlabs/php_codesniffer: *
- vimeo/psalm: ^5.18 || ^6
This package is auto-updated.
Last update: 2025-10-05 02:16:20 UTC
README
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.