fruitcake/php-decimal

Decimal class for PHP

dev-main / 1.0.x-dev 2023-03-31 12:19 UTC

This package is auto-updated.

Last update: 2024-04-11 08:23:04 UTC


README

Unit Tests PHPStan Level 5 Code Coverage Packagist License Latest Stable Version Total Downloads Fruitcake

Library for handling decimals in PHP

Installation

Require fruitcake/php-decimal using composer.

Example: using the library

<?php

use Fruitcake\Decimal\Decimal;

$decimal = new Decimal('1');
$value = $decimal->sub('0.8');

echo $decimal->toString(2); // "0.20"

License

Released under the MIT License, see LICENSE.