Swift framework providing type-safe value types for working with money, currency, and financial calculations across 298 ISO currencies.
Money is a Swift framework that provides value types for representing and calculating with money across 298 ISO currencies. It solves the problem of handling currency conversions, localized formatting, and type-safe financial calculations in Swift applications, preventing common errors like mixing different currencies.
iOS/macOS/watchOS/tvOS developers building applications that involve financial transactions, currency conversions, or any money-related calculations where type safety and proper localization are critical.
Developers choose Money for its strong type safety that prevents currency mixing errors, comprehensive localization support, and seamless integration with Apple Pay, all while leveraging Swift's modern language features for a clean and reliable API.
Swift value types for working with money & currency
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Prevents accidental mixing of currencies at compile time, as shown in the README where GBP + EUR causes a compile error, reducing bugs in financial calculations.
Automatically formats money based on the user's locale using NSNumberFormatter, with examples for US, UK, and China ensuring proper currency symbols and styles.
Provides PaymentSummaryItem types for easy integration with Apple Pay, simplifying payment request creation as demonstrated in the iOS code snippets.
Allows defining in-app currencies by conforming to CurrencyType, with an example for a bee emoji currency, making it flexible for virtual goods.
Supports Bitcoin types with appropriate symbols, using Ƀ due to Unicode limitations, catering to cryptocurrency needs in apps.
Foreign exchange functionality is not included and requires the separate FX framework, adding dependency management complexity for currency conversion.
Uses NSDecimalNumber instead of NSDecimal for decimal arithmetic, which the README admits is slower and less efficient for high-performance scenarios.
Advanced formatting requires using the custom Locale enum, which can be intricate for developers unfamiliar with locale identifiers and associated values.
Only supports Apple platforms (iOS, macOS, etc.), not suitable for Swift projects targeting Linux, Windows, or other non-Apple environments.