A Ruby library for handling monetary values and currency conversion with precision and flexibility.
RubyMoney is a Ruby library for handling monetary values and currency conversion in financial applications. It provides a `Money` class that encapsulates both value and currency information, using integer cents to avoid floating-point rounding errors. The library supports arithmetic operations, currency exchange, localized formatting, and integrates with Rails applications.
Ruby developers building financial applications, e-commerce platforms, or any system that needs to handle monetary values with precision and proper currency handling.
Developers choose RubyMoney for its accurate integer-based representation that prevents rounding errors, comprehensive currency support with ISO 4217 compliance, and flexible architecture that allows custom exchange rate stores and formatting rules.
A Ruby Library for dealing with money and currency conversion.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Stores monetary values as integers in cents to eliminate floating-point rounding errors, ensuring accurate financial calculations as emphasized in the README's features.
Encapsulates currency data in a dedicated Money::Currency class with ISO 4217 compliance, allowing easy extension and management of custom currencies.
Provides APIs for currency conversion with customizable exchange rate stores, enabling integration with databases, caches, or external APIs as shown in the Redis and ActiveRecord examples.
Integrates with Ruby's I18n gem for locale-specific formatting rules, making it adaptable for international audiences without hard-coded values.
Out-of-the-box, exchange rates must be manually added via Money.add_rate; automated real-time rates require additional gems or custom implementations, increasing complexity.
The README warns to read upgrade guides before major version upgrades, indicating potential backward compatibility issues that can disrupt existing codebases.
The library requires applications to use UTF-8 encoding, which may be a constraint in environments with different character sets or legacy systems.