PHP code example of toolstud-io / si_format

1. Go to this page and download the library: Download toolstud-io/si_format 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/ */

    

toolstud-io / si_format example snippets

 php
$obj = new ToolstudIo\SiFormat(false,"m");
echo $obj->format(1000000);
// returns "1km"
echo $obj->format(.001);
// returns "1mm"

$obj = new ToolstudIo\SiFormat(false,"B",1024);
echo $obj->format(1024);
// returns "1KB"