toolstud-io / si_format
PHP package to format numbers according to SI standards (milli, micro, nano... / Kilo, Mega, Giga...)
1.0.3
2021-12-05 13:03 UTC
Requires
- php: ^7.4|^8.0
Requires (Dev)
- phpunit/phpunit: ^9.0
- sempro/phpunit-pretty-print: ^1.4
- vimeo/psalm: ^4.12
README
PHP package to format numbers according to SI standards (e.g. mm, millimeter, Km, GB, Gigabyte, Gibibyte)
Installation
You can install the package via composer:
composer require toolstud-io/si_format
Usage
$obj = new ToolstudIo\SiFormat(false,"m"); echo $obj->format(1000000); // returns "1km" echo $obj->format(.001); // returns "1mm" $obj = new ToolstudIo\SiFormat(false,"B",1024); echo $obj->format(1024); // returns "1KB"
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email author_email instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.