PHP code example of konstantind / otus-flexible-float-parser

1. Go to this page and download the library: Download konstantind/otus-flexible-float-parser 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/ */

    

konstantind / otus-flexible-float-parser example snippets




$floatValue = FlexibleFloatParser::parse('3,14'); // 3.14
$floatValue = FlexibleFloatParser::parse('.5');   // 0.5
$floatValue = FlexibleFloatParser::parse('');     // null
$floatValue = FlexibleFloatParser::parse('abc');  // null