PHP code example of furthestworld / unitformat

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

    

furthestworld / unitformat example snippets


$origin_data    = [
    '2345124332',
    '3433443432',
    '12243433332',
    '7852323436'
];
$formatted_data = UnitFormat::formatDataUnit($origin_data, 10000, ['次', '万次', '亿次'], [1]);
var_dump($formatted_data);