PHPackages                             jaycodesign/decimal - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jaycodesign/decimal

ActiveLibrary

jaycodesign/decimal
===================

Simple wrapper around BC Math for simple math functions

v0.2(10y ago)22.2k1MITPHPCI failing

Since Dec 6Pushed 10y ago6 watchersCompare

[ Source](https://github.com/Jayco-Design/Decimal)[ Packagist](https://packagist.org/packages/jaycodesign/decimal)[ RSS](/packages/jaycodesign-decimal/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Decimal
=======

[](#decimal)

Simple wrapper around BC Math for simple math functions

Installation
------------

[](#installation)

Simply add a dependency to your project's `composer.json` file if you use [Composer](http://getcomposer.org/) to manage the dependencies of your project.

Here is a minimal example of a `composer.json` file that just defines a dependency on Decimal:

```
{
    "require": {
        "jaycodesign/decimal": "dev-master"
    }
}

```

Usage Examples
--------------

[](#usage-examples)

```
  use JaycoDesign\Decimal\Decimal;

  Decimal::mul(10, 5); // 50
  Decimal::div(10, 5); // 2
  Decimal::add(10, 5); // 15
  Decimal::sub(10, 5); // 5

  Decimal::greater_than(1,2); // TRUE
  Decimal::less_than(1,2); // FALSE

  Decimal::trim(10.3400000); // 10.34

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~105 days

Total

2

Last Release

3710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2b1d43282fc1ae974d0018b39f990788b7d5ceb2a0e65590901e70c7c14e876?d=identicon)[tenfef](/maintainers/tenfef)

---

Top Contributors

[![tenfef](https://avatars.githubusercontent.com/u/1075450?v=4)](https://github.com/tenfef "tenfef (12 commits)")

---

Tags

decimalbcmathbc math

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jaycodesign-decimal/health.svg)

```
[![Health](https://phpackages.com/badges/jaycodesign-decimal/health.svg)](https://phpackages.com/packages/jaycodesign-decimal)
```

###  Alternatives

[brick/math

Arbitrary-precision arithmetic library

2.1k504.0M277](/packages/brick-math)[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)[prestashop/decimal

Object-oriented wrapper/shim for BC Math PHP extension. Allows for arbitrary-precision math operations.

178.2M5](/packages/prestashop-decimal)[rtlopez/decimal

An object oriented immutable arbitrary-precision arithmetic library for PHP

27262.8k2](/packages/rtlopez-decimal)[krowinski/bcmath-extended

Extends php BCMath lib for missing functions like floor, ceil, round, abs, min, max, rand for big numbers. Also wraps existing BCMath functions. (more http://php.net/manual/en/book.bc.php) Supports scientific notations

791.0M19](/packages/krowinski-bcmath-extended)[php-decimal/php-decimal

Correctly-rounded arbitrary precision decimal floating point

781.0M9](/packages/php-decimal-php-decimal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
