2017 © Pedro Peláez
 

library human-readable

Convert numbers and seconds to the human readable format

image

vistag/human-readable

Convert numbers and seconds to the human readable format

  • Monday, January 29, 2018
  • by vistag
  • Repository
  • 0 Watchers
  • 0 Stars
  • 84 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 24 % Grown

The README.md

Human readable numbers and time

Human readable numbers and time package, (*1)

Installation

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)

Seconds

``` 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)

Support

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)

License

The MIT License (MIT). Vistag.com, (*17)

The Versions

29/01 2018

dev-master

9999999-dev https://github.com/VistagGit/human-readable

Convert numbers and seconds to the human readable format

  Sources   Download

MIT

The Requires

  • php ^5.4 || ^7.0

 

The Development Requires

numbers readable seconds human-readable