PHP code example of worksome / number

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

    

worksome / number example snippets


use Worksome\Number\Number;

$number = Number::of(100);

$number->mul(Number::of(5));

echo $number; // 500

use Worksome\Number\GraphQL\Scalars\PercentageType;
use Worksome\Number\GraphQL\Scalars\StrictPercentageType;

// In Lighthouse (https://lighthouse-php.com)
$typeRegistry->register(new PercentageType());
$typeRegistry->register(new StrictPercentageType());