Skip to content

A Class for converting a number to a human readable string with K,M,B,T etc.

License

Notifications You must be signed in to change notification settings

ECLIPSIO/number-humanoid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

number-humanoid

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

About

A Class for converting a number to a human readable string with K,M,B,T etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages