Format numbers, byte sizes, money and durations into readable text with predictable output, plus optional Intl locales.
composer require pharaonic/php-readableuse Pharaonic\Readable\{Bytes, Duration, Money, Number};
Number::compact(1250000); // "1.3M"
Bytes::format(1536, binary: true); // "1.5 KiB"
Money::format(1234.5, 'USD'); // "USD 1,234.50"
Duration::format(3661); // "1 hour 1 minute 1 second"Full documentation: PHP Readable Documentation.
See SUPPORT.md and SECURITY.md. Contributions are welcome; see CONTRIBUTING.md.
MIT. See LICENSE.
