This repository was archived by the owner on May 12, 2025. It is now read-only.
Open
Conversation
Money.disallow_currency_conversion! Money.new(0, 'USD') == Money.new(0, 'AUD') # => true This is consistent with the already existing Money.new(0, 'USD').eql? Money.new(0, 'AUD') # => true
Allow comparing cross currency when both are zero
* Adjusted attribute name in readme text * Adjusted value of the attributes that were edited * Adjusted attributes names in help text
It was using postal mark: http://unicodelookup.com/#〒/1
* add Chinese Yuan Offshore (CNH) * add disambiguate symbol for CNH
There’s no reason to perform coercion here since since the result isn’t saved and Money#amounts_from_splits doesn’t perform coercion either. See RubyMoney#725
Steps to reproduce the bug: 1. start a new ruby console 2. require 'money'; Money.zero(:usd); Money.zero You will see the error
Fixes a vulnerability in older yard versions
I see no reason for locking at patch version and non-semver.
* Add Bitcoin Cash Adding in Bitcoin cash to this gem to be useful for anyone using the gem and wishing to have all of the same advantages as any other currency. * Update AUTHORS * Update currency_non_iso.json * added more test coverage
…ney#823) * fixed specs * remove VEF from currency_non_iso
Add explicit "per currency" localisation
…ounts Disallow initializing Money with non-finite amounts
* Add documentation for rounding mode. Based on comments from RubyMoney#707 * Clarify the role of `infinite_precision` and how the `round` method works.
* Remove version constraint on Bundler gem * Ensure Bundler is installed on CI agents * Ensure Bundler version 1.17.3 is installed For compatibility with legacy Ruby releases * Pin i18n to v1.2 on Ruby 2.0, 2.1 and 2.2 * Loosen constraints on i18n gem * Loosen constraints on Bundler version We can remove this once we've stopped supporting legacy versions of Ruby.
This leads to an error when attempting to allocate a zero value, and the zero value is the first argument in parts. Example: ``` [1] pry(main)> Money.new(100, "USD").allocate([1, 1, 0]) => [#<Money fractional:50 currency:USD>, #<Money fractional:50 currency:USD>, #<Money fractional:0 currency:USD>] [2] pry(main)> Money.new(100, "USD").allocate([0, 1, 1]) ZeroDivisionError: divided by 0 [3] pry(main)> Money.new(100, "USD").allocate([1, 1, 0.0]) => [#<Money fractional:50 currency:USD>, #<Money fractional:50 currency:USD>, #<Money fractional:0 currency:USD>] [4] pry(main)> Money.new(100, "USD").allocate([0.0, 1, 1]) FloatDomainError: NaN ```
* extract currency table concerns to own class * remove thread safety things since they are causing more trouble than they are worth for us * extract custom error classes * also removes the strange initializing behavior in favor of something more straightforward
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.