PHP code example of tayron / float-object

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

    

tayron / float-object example snippets



use Tayron\FloatObject::;
    
try{ 
    $numA = new FloatObject(100.59);
    $numB = new FloatObject(1.37);
    var_dump($numB);
    
    $numA->addition($numB);
    

    var_dump($numA);
    var_dump($numB);
    
    var_dump($numA->isEquals($numB));

    $numA = new FloatObject('1.65');
    var_dump($numA->isEquals($numB));
    var_dump($numA->format(2, ',', '.'));
}catch(\Exception $e){
    echo $e->getMessage();
}