Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Fix the symbols for IQD (Iraqi Dinar) and LYD (Libyan Dinar), which had their letters in reverse order: "د.ع" and "د.ل", like BHD in #958
- Fix `Money::Allocation.generate` converting a Rational with unlimited `to_d` precision. It now uses `Money.conversion_precision`
- Fix `Money::Currency.reset!` keeping the cached key set, so a currency registered before the reset was still accepted by `Money::Currency.new` and raised `NoMethodError` instead of `UnknownCurrency`
- Fix `Money::Bank::VariableExchange#import_rates` parsing `:json` with `JSON.load`, which instantiates any class named by a `json_class` key; it now uses `JSON.parse`
Expand Down
4 changes: 2 additions & 2 deletions config/currency_iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -1003,7 +1003,7 @@
"priority": 100,
"iso_code": "IQD",
"name": "Iraqi Dinar",
"symbol": "ع.د",
"symbol": "د.ع",
"alternate_symbols": [],
"subunit": "Fils",
"subunit_to_unit": 1000,
Expand Down Expand Up @@ -1320,7 +1320,7 @@
"priority": 100,
"iso_code": "LYD",
"name": "Libyan Dinar",
"symbol": "ل.د",
"symbol": "د.ل",
"alternate_symbols": ["LD"],
"subunit": "Dirham",
"subunit_to_unit": 1000,
Expand Down
5 changes: 5 additions & 0 deletions spec/money/formatting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@
expect(Money.new(10_00, "BHD").format).to eq "د.ب1.000"
end

it "writes Arabic dinar symbols starting with dal, like BHD" do
expect(Money.new(10_000, "IQD").format).to eq "10.000 د.ع"
expect(Money.new(10_000, "LYD").format).to eq "10.000 د.ل"
end

context "when :subunit_to_unit is 1" do
it "does not display a decimal part" do
expect(Money.new(10_00, "VUV").format).to eq "Vt1,000"
Expand Down
Loading