Skip to content

Releases: kipcole9/money

Ex Money version 6.0.0-rc.0

23 Apr 17:35

Choose a tag to compare

Breaking Changes

  • The ex_cldr, ex_cldr_numbers, and ex_cldr_units dependencies have been replaced by localize.

  • The CLDR backend system has been removed entirely. There is no longer a need to define a backend module (e.g. MyApp.Cldr) or configure use Cldr, providers: [Money]. The Money.Backend module has been deleted.

  • The :backend option has been removed from all public functions including Money.new/3, Money.to_string/2, Money.parse/2, and Money.localize/2. Locale resolution now uses Localize.get_locale/0 by default.

  • The Money.default_backend!/0 and Money.default_backend/0 functions have been removed.

  • The Money.cldr_backend_provider/1 callback has been removed.

  • The configuration keys default_cldr_backend (in :ex_money) and default_backend (in :ex_cldr) are no longer used.

  • Error messages from currency validation have changed. For example, "The currency :ZZZ is unknown" is now "The currency :ZZZ is not known." (the message comes from Localize.UnknownCurrencyError).

  • gringotts support is removed.

  • Currency lists returned by Money.Currency.known_current_currencies/0, Money.Currency.known_historic_currencies/0, and Money.Currency.known_tender_currencies/0 have been updated to reflect newer CLDR data. Some currencies have moved between current and historic status.

Enhancements

  • All CLDR functionality is now provided by the single localize package, simplifying the dependency tree and removing the need for compile-time backend configuration.

  • Custom currencies are now managed in ex_money rather than localize. See Money.Currency.new.

  • Locale management is now handled at runtime via Localize.get_locale/0 and Localize.put_locale/1, consistent with how Gettext manages locales.

  • digital_token is now an explicit optional dependency rather than a transitive dependency through ex_cldr.

  • The Money.Subscription.Plan.to_string/2 function now uses Localize.Unit for compound currency-per-unit formatting.

Ex Money version 5.24.2

29 Jan 18:40

Choose a tag to compare

Bug Fixes

  • Fix deprecated map.field notation in Money.parse_decimal/4. Thanks to @oliver-kriska for the PR. Closes #191.

Ex Money version 5.24.1

21 Jan 20:09

Choose a tag to compare

Bug Fixes

  • Fixes casting a binary currency code that is both a valid ISO4217 currency code and a valid digital currency short code (for example, "TRY"). Precedence is given to returning the ISO4217 code (this was not the case in v5.24.0).

Ex Money version 5.24.0

18 Jan 09:16

Choose a tag to compare

Bug Fixes

  • Fixes compile warnings on Elixir 1.20.

  • Fix examples in README.md to align with the current inspect/2 output. Thanks very much to @carlgleisner for the PR (and apologies for the long delayed merge). Closes #188.

Enhancements

  • Add Money.spread/3 to proptionally allocate (that is, spread) am money amount amongst a list of amounts or integers. Thanks to @jdewar for the PR and great patience. Closes #175.

  • Add support for custom currency codes. A custom currency code is created with Cldr.Currency.new/2 and is distinguised from an ISO4217 code by being at least 4 characters long (ISO4217 codes are always 3 characters long). The first character must be a Latin alphabetic character. The additional characters must be Latin alphanumeric characters.

Ex Money version 5.23.0

24 Aug 18:57

Choose a tag to compare

Enhancements

Ex Money version 5.22.0

15 Aug 11:00

Choose a tag to compare

Enhancements

  • Adds Money.Subscription.Plan.to_string/2 to return a localized string representation of a subscription plan. The implementation is conditional on ex_cldr_units being configured as a dependency in mix.exs and Cldr.Unit being added as a provider in the CLDR backend module. Thanks to @peaceful-james for the suggestion. Closes #186.

Ex Money version 5.21.0

29 Mar 22:24

Choose a tag to compare

Enhancements

  • Add JSON.Encoder implementation to support serializing money types with Elixir's JSON module. Thanks to @jfpedroza for the PR. Closes #182.

Ex Money version 5.20.0

18 Mar 21:16

Choose a tag to compare

Soft Deprecation

  • The option :fractional_digits for Money.from_integer/3 has been deprecated in favour of :currency_digits for consistency with Money.round/2 and functions in ex_cldr_numbers. :fractional_digits will continue to be supported for an indefinite period.

Bug Fixes

  • Ensure Money.split/3 always returns a remainder that is greater than or equal to 0. Thanks to @jdewar for the report and @coladarci, @Wigny for their collaboration. Closes #173.

  • Allow a non-breaking-space to be part of a number string. Some locales (like en-ZA) will format numbers with a nbsp when using standard separators for that locale.

  • Fix documentation for Money.ExchangeRates replacing :exchange_rate_service with :auto_start_exchange_rate_service. Thanks to @cw789 for the PR. Closes #174.

Enhancements

  • Update to CLDR 47 data including update to ISO 4217 currency information.

  • Support passing rounding options to Money.split/3.

Ex Money version 5.19.2

12 Feb 19:19

Choose a tag to compare

Bug Fixes

  • Fix using Elixir 1.18's JSON module in ex_money (specifically decoding exchange rates). Thanks to @allenwyma and @maikelthedev for the report. Closes #176.

  • Document currency_symbol: :none option for Money.to_string/2. This option formats the money amount without a currency symbol. This may be useful for UI forms that separate the currency and the amount for input. Requires ex_cldr_numbers version 2.33.6 or later.

  • Fix parsing money strings that contain trailing RTL markers. Requires ex_cldr_currencies version 2.16.4 or later.

Ex Money version 5.19.1

22 Jan 07:34

Choose a tag to compare

Bux Fixes

  • Fixes Money.within/3 when min and max are the same. Thanks to @joewunderlich for the report. Closes #177.