PHPackages                             tourze/doctrine-precision-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. [Database &amp; ORM](/categories/database)
4. /
5. tourze/doctrine-precision-bundle

ActiveLibrary[Database &amp; ORM](/categories/database)

tourze/doctrine-precision-bundle
================================

Doctrine精度增强

1.1.0(6mo ago)08834MITPHPCI passing

Since Apr 19Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/doctrine-precision-bundle)[ Packagist](https://packagist.org/packages/tourze/doctrine-precision-bundle)[ RSS](/packages/tourze-doctrine-precision-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (17)Versions (8)Used By (4)

Doctrine Precision Bundle
=========================

[](#doctrine-precision-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![PHP Version](https://camo.githubusercontent.com/ee631d1b3535e8b3a99c9152d465e9db0c74b77d6c84694515f8ebc38cda9aea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c75653f7374796c653d666c61742d737175617265)](https://www.php.net/)[![Symfony Version](https://camo.githubusercontent.com/e42e7a9cf14b1978c043ea01b328af520235ef3fe9d7f0431f2a58c063cea9a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d253545362e342d677265656e3f7374796c653d666c61742d737175617265)](https://symfony.com/)[![License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)

[![Build Status](https://camo.githubusercontent.com/77ae6ab3dd1e88aebee37747e23b2099a56655b015cbfc50eacc3ec980f15858/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f746f75727a652f646f637472696e652d707265636973696f6e2d62756e646c652f43493f7374796c653d666c61742d737175617265)](https://github.com/tourze/doctrine-precision-bundle/actions)[![Code Coverage](https://camo.githubusercontent.com/2d595ed349096d914b3b1cec17e3af759a76f389bd68e15c4525eeab6dab2e8f/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f646f637472696e652d707265636973696f6e2d62756e646c653f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/doctrine-precision-bundle)

[![Latest Version](https://camo.githubusercontent.com/22663d51964671455ef445e77959f3d810fab197561b6d0158d1bac6c4ac18c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f646f637472696e652d707265636973696f6e2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/doctrine-precision-bundle)[![Total Downloads](https://camo.githubusercontent.com/ddbf2c7a7cfc6fcb23053ae245f4d1f0f2045cf0d2676e327e98f1a7dba21373/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f75727a652f646f637472696e652d707265636973696f6e2d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/doctrine-precision-bundle)

A Symfony bundle that enhances Doctrine ORM by providing automatic precision control for decimal fields using PHP attributes.

Features
--------

[](#features)

- ✅ Automatically applies consistent precision to decimal fields across your application
- ✅ Uses environment variables to configure precision values
- ✅ Simple PHP 8+ attribute-based implementation
- ✅ Seamless integration with Doctrine ORM event system
- ✅ Supports PHP 8.1+ and Symfony 6.4+
- ✅ Zero configuration required for basic usage

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

[](#installation)

```
composer require tourze/doctrine-precision-bundle
```

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine ORM 3.0 or higher

Quick Start
-----------

[](#quick-start)

### 1. Register the bundle

[](#1-register-the-bundle)

The bundle should be automatically registered if you're using Symfony Flex. If not, add it to your `config/bundles.php`:

```
