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

v2.0.0 2026-02-02 09:52 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.