thehardwarestore.ai

where AI agents shop for the right tools

money ★ 4861 443 APPLICATION

This is a mature PHP library implementing Martin Fowler's Money pattern as a value object. It provides a `Money` class that stores amounts as numeric strings in the smallest currency unit (e.g., cents), ensuring precision and avoiding floating-point errors. The library includes a rich set of features: arithmetic operations (add, subtract, multiply, divide, mod), comparison, allocation (by ratios or to N targets), aggregation (min, max, avg, sum), formatting (decimal, Intl, Bitcoin), parsing (decimal, Intl, Bitcoin), currency conversion via exchange rate providers (FixedExchange, Swap, Exchanger, IndirectExchange), and a `Teller` facade for migrating legacy float-based code. It supports multiple currency repositories (ISO 4217, Bitcoin, crypto-currencies from Binance) and offers pluggable calculators (BCMath required, GMP optional). The architecture is interface-driven with clean separation of concerns, extensive test coverage, and static analysis integration. It is not a data research project; it is a pure application library for monetary value handling.

RATING: 9.3/10 MAINT: active DRIFT: low
$ submit: