fruitcake/php-decimal

Decimal class for PHP

Fund package maintenance!
barryvdh
fruitcake.nl

Installs: 1 987

Dependents: 0

Suggesters: 0

Security: 0

Stars: 13

Watchers: 3

Forks: 0

Open Issues: 0

pkg:composer/fruitcake/php-decimal

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

This package is auto-updated.

Last update: 2025-09-11 11:05:41 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.