Brick\Money is a PHP library designed to provide precise and reliable handling of monetary values using arbitrary-precision arithmetic, ensuring accuracy in financial calculations of any scale. Built on top of the brick/math library, it avoids floating point errors by using exact decimal representations, making it suitable for applications where correctness is critical, such as accounting and financial services. The library supports ISO 4217 currency standards and includes comprehensive tools for working with currency units, conversions, and rounding strategies. It is designed to handle large numbers and complex operations without loss of precision, which is essential for enterprise-level financial systems. Brick\Money also emphasizes immutability, ensuring that operations return new objects rather than modifying existing ones, which improves predictability and safety in codebases.
Features
- Arbitrary-precision arithmetic for exact financial calculations
- Compliance with ISO 4217 currency standards
- Immutable money objects for safe operations
- Support for large values and high-precision computations
- Flexible rounding and conversion strategies
- Integration with PHP ecosystems via Composer