PHPackages                             saki/bcmath-number-polyfill - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. saki/bcmath-number-polyfill

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

saki/bcmath-number-polyfill
===========================

1.1.0(1y ago)810.0k—10%MITPHPPHP ^8.3 || ^8.2

Since Dec 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/SakiTakamachi/BcMath-Number-Polyfill)[ Packagist](https://packagist.org/packages/saki/bcmath-number-polyfill)[ RSS](/packages/saki-bcmath-number-polyfill/feed)WikiDiscussions main Synced 1mo ago

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

BcMath\\Number Polyfill
=======================

[](#bcmathnumber-polyfill)

[![Latest Stable Version](https://camo.githubusercontent.com/64cb20b1749b159ae09f7724a014128caa70b411545ab1e5a76c61cbaccf02f1/68747470733a2f2f706f7365722e707567782e6f72672f73616b692f62636d6174682d6e756d6265722d706f6c7966696c6c2f76)](https://packagist.org/packages/saki/bcmath-number-polyfill)[![Push](https://github.com/SakiTakamachi/BcMath-Number-Polyfill/actions/workflows/push.yml/badge.svg)](https://github.com/SakiTakamachi/BcMath-Number-Polyfill/actions/workflows/push.yml)[![codecov](https://camo.githubusercontent.com/2f1f66a64077cb8094e0cc8cd0907fed0fd04775dccb9e9d1539af9f7132fffe/68747470733a2f2f636f6465636f762e696f2f67682f53616b6954616b616d616368692f42634d6174682d4e756d6265722d506f6c7966696c6c2f67726170682f62616467652e7376673f746f6b656e3d534559435935374c5259)](https://codecov.io/gh/SakiTakamachi/BcMath-Number-Polyfill)[![License](https://camo.githubusercontent.com/30127a2ae5a48e26594c8579850dfe46ff5612a03d3f70002ba6b7fc5ebb36f9/68747470733a2f2f706f7365722e707567782e6f72672f73616b692f62636d6174682d6e756d6265722d706f6c7966696c6c2f6c6963656e7365)](https://packagist.org/packages/saki/bcmath-number-polyfill)[![PHP Version Require](https://camo.githubusercontent.com/eaa4c5da58ebb3a26fb0ace3bfbdc5c30bbfa2435e9eab10edf049986e69f8e9/68747470733a2f2f706f7365722e707567782e6f72672f73616b692f62636d6174682d6e756d6265722d706f6c7966696c6c2f726571756972652f706870)](https://packagist.org/packages/saki/bcmath-number-polyfill)

Install
-------

[](#install)

```
composer require saki/bcmath-number-polyfill

```

This library requires the BCMath extension. Also, since this is a polyfill, it does **not support** PHP 8.4 or higher. For PHP 8.2 and 8.3 only.

Description
-----------

[](#description)

This is a polyfill for `BcMath\Number` class added in PHP 8.4. It achieves the same behavior as much as possible, but does **not support** operator overloading.

`RoundingMode` Enum is also included. However, if it has already been defined, it will not be defined twice.

New functions such as `bcround()` are not included in this library.

How to use
----------

[](#how-to-use)

You can treat it like anything added in PHP 8.4.

```
use BcMath\Number;

$number = new Number('1.23');
$rounded = $number->round(1, RoundingMode::AwayFromZero);

var_dump($rounded);

```

result:

```
object(BcMath\Number)#3 (2) {
  ["value"]=>
  string(3) "1.3"
  ["scale"]=>
  int(1)
}

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community8

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 ~1 days

Total

2

Last Release

526d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53299f3c3e6b8654e99f64274bdaa41d8d54f063951d848ff4d0c9ecdac0a7eb?d=identicon)[SakiTakamachi](/maintainers/SakiTakamachi)

---

Top Contributors

[![SakiTakamachi](https://avatars.githubusercontent.com/u/34942839?v=4)](https://github.com/SakiTakamachi "SakiTakamachi (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/saki-bcmath-number-polyfill/health.svg)

```
[![Health](https://phpackages.com/badges/saki-bcmath-number-polyfill/health.svg)](https://phpackages.com/packages/saki-bcmath-number-polyfill)
```

###  Alternatives

[nelsonsar/nash

111.0k](/packages/nelsonsar-nash)

PHPackages © 2026

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