1. Go to this page and download the library: Download nicmart/numbers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
nicmart / numbers example snippets
use Numbers\Number;
$n = new Number(3.1415926535898);
$n = Number::n(3.1415926535898);
var_dump($n->get()); //double(3.1415926535898)
$n->round(5)->get(); // returns 3.1416
(new Number(0.000123456))->round(5)->get(); // returns 0.00012346
// Prints "1.23k"
echo Number::n(1234.567)->round(3)->getSuffixNotation();
// Prints "79G"
echo Number::n(79123232123)->round(2)->getSuffixNotation();
// Prints "123.4µ"
echo Number::n(0.0001234)->getSuffixNotation();
// Prints "123,123.23"
echo Number::n(123123.23)->format();
// Prints "123 123,23"
echo Number::n(123123.23)->format(',', ' ');