PHP code example of james-pro / string-to-number

1. Go to this page and download the library: Download james-pro/string-to-number 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/ */

    

james-pro / string-to-number example snippets


use JamesPro\StringToNumber;

$number = Format::makeNumber('123,456789',2);
echo $number;
// 123.46

$number = Format::makeNumber('123,4444456789',2);
echo $number;
// 123.45