A Ruby library for converting strings, numbers, and other objects into Money objects with flexible parsing.
Monetize is a Ruby library designed to parse and convert various objects—such as strings with currency symbols, numbers, or collections—into standardized `Money` objects. It solves the problem of inconsistently formatted monetary data by providing flexible, configurable parsing that handles currency detection, locale-specific formats, and edge cases like whole subunits.
Ruby developers, particularly those working on financial applications, e-commerce platforms, or any project requiring reliable monetary data processing and integration with the RubyMoney ecosystem.
Developers choose Monetize for its seamless integration with the `money` gem, its configurable parsing options (like currency symbol detection and whole subunit handling), and its ability to accurately process diverse monetary input formats with minimal code.
A library for converting various objects into Money objects.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Converts strings (e.g., 'USD 100'), numbers, and collections into Money objects, supporting diverse formats like currency symbols and mixed lists, as shown in the README examples.
Allows inferring currency from symbols (e.g., £ → GBP) when assume_from_symbol is enabled, improving accuracy for international inputs without explicit currency codes.
Configurable with expect_whole_subunits to correctly parse formats like 'EUR 10,000' as thousands, avoiding misinterpretation as decimal values based on locale.
Works directly with the money gem for arithmetic, formatting, and currency operations, enabling consistent monetary data processing in Ruby apps.
Defaults to USD for unrecognized symbols unless assume_from_symbol is set, risking silent errors in international contexts where other currencies are intended.
Requires explicit settings like assume_from_symbol and expect_whole_subunits for accurate parsing, adding initial setup complexity and potential misconfiguration.
Tied to the RubyMoney ecosystem, making it unsuitable for polyglot projects or environments outside Ruby, limiting cross-platform compatibility.
Parsing accuracy depends on human-like context (e.g., retail vs. stock prices), which might still lead to edge cases without additional validation logic.