dev-master
9999999-dev https://github.com/VistagGit/human-readableConvert numbers and seconds to the human readable format
MIT
The Requires
- php ^5.4 || ^7.0
The Development Requires
numbers readable seconds human-readable
Convert numbers and seconds to the human readable format
Human readable numbers and time package, (*1)
You can install this package via composer using this command:, (*2)
``` bash composer require vistag/human-readable, (*3)
## Usage ### Numbers ``` php use Vistag\HumanReadable\ReadableNumber; $number = new ReadableNumber(550); $number->raw(); // 550 $number->short(); // 550 $number->long(); // 550 $number = new ReadableNumber(1515); $number->short(); // 1.5k $number->long(); // 1.51k $number = new ReadableNumber(155550); $number->short(); // 155k $number->long(); // 155.55k $number = new ReadableNumber(5999900); $number->short(); // 5.9M $number->long(); // 5.99M
See tests for more examples., (*4)
``` php use Vistag\HumanReadable\ReadableSeconds;, (*5)
$seconds = new ReadableSeconds(990);, (*6)
$seconds->raw(); // 990 $seconds->short(); // 990s $seconds->long(); // 16m 30s, (*7)
$seconds = new ReadableSeconds(1010);, (*8)
$seconds->short(); // 16m $seconds->long(); // 16m 50s, (*9)
$seconds = new ReadableSeconds(155550);, (*10)
$seconds->short(); // 151m $seconds->long(); // 2h 31m, (*11)
$seconds = new ReadableSeconds(5999900);, (*12)
$seconds->short(); // 27h $seconds->long(); // 27.6h ```, (*13)
See tests for more examples., (*14)
If you believe you have found an issue, please report it using the GitHub issue tracker, or better yet, fork the repository and submit a pull request., (*15)
If you're using this package, I'd love to hear your thoughts. Thanks!, (*16)
The MIT License (MIT). Vistag.com, (*17)
Convert numbers and seconds to the human readable format
MIT
numbers readable seconds human-readable