PHPackages                             prgtw/big-number-serializer-bundle - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. prgtw/big-number-serializer-bundle

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

prgtw/big-number-serializer-bundle
==================================

Bundle for serializing BigNumber classes to/from string representation using JmsSerializer

1.1.0(5y ago)0225.5k↓56.5%MITPHPPHP ^7.4 || ^8.0CI failing

Since Apr 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/prgTW/big-number-serializer-bundle)[ Packagist](https://packagist.org/packages/prgtw/big-number-serializer-bundle)[ RSS](/packages/prgtw-big-number-serializer-bundle/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (8)Versions (6)Used By (0)

BigNumberSerializerBundle
=========================

[](#bignumberserializerbundle)

[![GitHub license](https://camo.githubusercontent.com/7319c29ab5fdf8e226d33d8dddbb41edb0baf946801b3aa47250cf8f2554add9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70726774772f6269672d6e756d6265722d73657269616c697a65722d62756e646c65)](https://github.com/prgTW/big-number-serializer-bundle/blob/main/LICENSE)[![Packagist](https://camo.githubusercontent.com/20011c199d3ce63187eafc1ef6666076d654d908883f23e774858d7712948112/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726774772f6269672d6e756d6265722d73657269616c697a65722d62756e646c65)](https://packagist.org/packages/prgtw/big-number-serializer-bundle)[![GitHub Workflow Status](https://camo.githubusercontent.com/c8df48eede90160c9cc928d8ea3b73691fb8ea82ea48c0d2236772afdf0ec481/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70726754572f6269672d6e756d6265722d73657269616c697a65722d62756e646c652f5465737473)](https://camo.githubusercontent.com/c8df48eede90160c9cc928d8ea3b73691fb8ea82ea48c0d2236772afdf0ec481/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f70726754572f6269672d6e756d6265722d73657269616c697a65722d62756e646c652f5465737473)

Bundle for serializing [BigNumber](https://github.com/brick/math) classes to/from `string` representation using [JmsSerializer](https://github.com/schmittjoh/serializer).

Installation
============

[](#installation)

1. Require the `prgtw/big-number-serializer-bundle` package in your `composer.json`and update your dependencies.

    ```
    composer require prgtw/big-number-serializer-bundle
    ```
2. Add the `BigNumberSerializerBundle` to your application's kernel:

    ```
    public function registerBundles()
    {
    	$bundles = [
    		// ...
    		new prgTW\BigNumberSerializerBundle(),
    		// ...
    	];
    	// ...
    }
    ```

Example
=======

[](#example)

```
/**
 * @Serializer\ExclusionPolicy("NONE")
 */
class Temp
{
	/**
	 * @Serializer\SerializedName("integer")
	 * @Serializer\Type("Brick\Math\BigInteger")
	 */
	private BigInteger $integer;

	/**
	 * @Serializer\SerializedName("decimal")
	 * @Serializer\Type("Brick\Math\BigDecimal")
	 */
	private BigDecimal $decimal;

	/**
	 * @Serializer\SerializedName("rational")
	 * @Serializer\Type("Brick\Math\BigRational")
	 */
	private BigRational $rational;

	public function __construct(BigInteger $integer, BigDecimal $decimal, BigRational $rational)
	{
		$this->integer  = $integer;
		$this->decimal  = $decimal;
		$this->rational = $rational;
	}

	public function getInteger(): BigInteger
	{
		return $this->integer;
	}

	public function getDecimal(): BigDecimal
	{
		return $this->decimal;
	}

	public function getRational(): BigRational
	{
		return $this->rational;
	}
}

// ----------------------------------------

$temp = new Temp(
	BigInteger::of('12345'),
	BigDecimal::of('123.4'), // scaled to 2 decimal places
	BigRational::of('4/7')
);

echo $jmsSerializer->serialize($temp, 'json');
```

Results
-------

[](#results)

### Before (without bundle)

[](#before-without-bundle)

```
{
  "integer": {"value": "12345"},
  "decimal": {"value": "12340", "scale": 2},
  "rational": {"numerator": {"value":"4"}, "denominator": {"value":"7"}}
}
```

### After (using bundle)

[](#after-using-bundle)

```
{
  "integer": "12345",
  "decimal": "123.40",
  "rational": "4\/7"
}
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

5

Last Release

1914d ago

Major Versions

0.1.2 → 1.0.02021-04-06

PHP version history (2 changes)0.1.0PHP ^7.0

1.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/69f6df2cde2ee864e1ea5ec591e9a586ed97994c87996944194ef03e2ad63086?d=identicon)[prgTW](/maintainers/prgTW)

---

Top Contributors

[![prgTW](https://avatars.githubusercontent.com/u/203249?v=4)](https://github.com/prgTW "prgTW (13 commits)")

---

Tags

symfonybundlebrickserializermath

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prgtw-big-number-serializer-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/prgtw-big-number-serializer-bundle/health.svg)](https://phpackages.com/packages/prgtw-big-number-serializer-bundle)
```

PHPackages © 2026

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