Skip to content

Commit

Permalink
Add Second Ouguiya MRU 929 to currency iso file (#853)
Browse files Browse the repository at this point in the history
* Add Second Ouguiya MRU 929 to currency iso file

* Remove currency MRO (has been superseded by MRU)

The first Mauritanian Ouguiya (currency code MRO, ISO code 478) has been
replaced by the second Ouguiya (currency code MRU, ISO code 929) on
January 01, 2018. Fore more informatiom, see the following links:

    https://en.wikipedia.org/wiki/ISO_4217
    https://en.wikipedia.org/wiki/Mauritanian_ouguiya

* Fix unit tests after replacing MRO by MRU

* Make sure deprecated currency MRO is not mentioned anywhere in the code

* Fix unit tests

* Add MRO to currency_backwards_compatible.json

The disambiguate symbol "A-UM" has been added for MRO, see

    https://www.bcm.mr/IMG/pdf/directives_techniques.pdf
  • Loading branch information
dmitrychopey authored and antstorm committed Aug 8, 2019
1 parent 8754d9a commit 53f9a6e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
16 changes: 16 additions & 0 deletions config/currency_backwards_compatible.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,22 @@
"iso_numeric": "428",
"smallest_denomination": 1
},
"mro": {
"priority": 100,
"iso_code": "MRO",
"name": "Mauritanian Ouguiya",
"symbol": "UM",
"disambiguate_symbol": "A-UM",
"alternate_symbols": [],
"subunit": "Khoums",
"subunit_to_unit": 5,
"symbol_first": false,
"html_entity": "",
"decimal_mark": ".",
"thousands_separator": ",",
"iso_numeric": "478",
"smallest_denomination": 1
},
"mtl": {
"priority": 100,
"iso_code": "MTL",
Expand Down
6 changes: 3 additions & 3 deletions config/currency_iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -1412,9 +1412,9 @@
"iso_numeric": "446",
"smallest_denomination": 10
},
"mro": {
"mru": {
"priority": 100,
"iso_code": "MRO",
"iso_code": "MRU",
"name": "Mauritanian Ouguiya",
"symbol": "UM",
"alternate_symbols": [],
Expand All @@ -1424,7 +1424,7 @@
"html_entity": "",
"decimal_mark": ".",
"thousands_separator": ",",
"iso_numeric": "478",
"iso_numeric": "929",
"smallest_denomination": 1
},
"mur": {
Expand Down
2 changes: 1 addition & 1 deletion lib/money/currency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def iso?

# Returns the relation between subunit and unit as a base 10 exponent.
#
# Note that MGA and MRO are exceptions and are rounded to 1
# Note that MGA and MRU are exceptions and are rounded to 1
# @see https://en.wikipedia.org/wiki/ISO_4217#Active_codes
#
# @return [Integer]
Expand Down
2 changes: 1 addition & 1 deletion spec/currency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ def to_s

describe "#decimal_places" do
it "proper places for known currency" do
expect(described_class.new(:mro).decimal_places).to eq 1
expect(described_class.new(:mru).decimal_places).to eq 1
expect(described_class.new(:usd).decimal_places).to eq 2
end

Expand Down

0 comments on commit 53f9a6e

Please sign in to comment.