fruitcake / php-decimal
Decimal class for PHP
v2.0.0
2026-02-02 09:52 UTC
Requires
- php: ^8.2
- ext-intl: *
- brick/math: ^0.9.3|^0.10|^0.11|^0.12|^0.13|^0.14
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.93
- phpstan/phpstan: ^1.10|^2
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^10
This package is auto-updated.
Last update: 2026-03-02 09:56:20 UTC
README
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.