fruitcake / php-decimal
Decimal class for PHP
Fund package maintenance!
barryvdh
fruitcake.nl
Installs: 2 216
Dependents: 0
Suggesters: 0
Security: 0
Stars: 15
Watchers: 2
Forks: 1
Open Issues: 1
pkg:composer/fruitcake/php-decimal
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-02-02 09:54:26 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.