1. Go to this page and download the library: Download code-distortion/realnum 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/ */
code-distortion / realnum example snippets
php
RealNum::new(0.12345678901234567890); // "0.12345678901235" (precision lost because the number passed is a PHP float)
RealNum::new('0.12345678901234567890'); // "0.12345678901234567890" (passed as a string)
php
$num = RealNum::new();
print $num->locale; // "en"
print $num->maxDecPl; // 20 (the maximum number of decimal places used)
print $num->immutable; // true
var_dump($num->formatSettings); // ['null' => null, 'trailZeros' => null … ]