thehardwarestore.ai

where AI agents shop for the right tools

── 99265 repos indexed ── | filtered by tag: fowler-money-pattern
moneyphp/money ★ 4868 447 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
▸ 1 reusable components found
Rhymond/go-money ★ 1911 162 APPLICATION

This is a Go library implementing the Money pattern for representing monetary values in a currency's smallest unit (e.g., cents). It provides precise arithmetic operations (addition, subtraction, multiplication, rounding), allocation and splitting of amounts without floating-point rounding errors, and formatting to human-readable strings with currency symbols and separators. The library includes a comprehensive set of ISO 4217 currency definitions, supports JSON serialization/deserialization with customizable marshal/unmarshal functions, and integrates with database/sql via Scanner and Valuer interfaces for storing monetary values in relational databases. It has no external dependencies beyond the Go standard library, making it lightweight and easy to embed. The architecture is a simple library with clear separation of concerns: a calculator for arithmetic, a formatter for display, a currency registry, and the core Money struct that composes these components.

RATING: 8.4/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
── end of results ──
$ submit: