eclipsio / number-humanoid
Convert Number to Identifier in K(thousands), M(Millions), B(Billions), T(Trillions).
Installs: 76
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/eclipsio/number-humanoid
Requires
- php: ^7.2 || ^8.0
README
A Class for converting a number to a human readable string with K,M,B,T etc.
Install
composer require eclipsio/number-humanoid
Example Human Readable String
<?php use Eclipsio\NumberHumanoid\Humanoid; $num = 10200; $human = new Humanoid($num); echo $human->out; // 10.20K echo $human->number; // 10.20 echo $human->expression; // K
Number to Words
This Class allows to conver a number to words, which supports about quadrillion as well as decimals too.
How to use
use Eclipsio\NumberHumanoid\NumberToWords; $num = 71176482.556; $str = NumberToWords::toWords($num); echo $str;
Output will be
seventy one millions one hundred seventy six thousands four hundred eighty two point five five six