Skip to content

Commit

Permalink
Merge branch 'main' into bug.fix-format-deprecation-warning-message
Browse files Browse the repository at this point in the history
  • Loading branch information
semmons99 authored Oct 1, 2023
2 parents d510acf + 2e4748a commit 85184d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/currency_iso.json
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@
"subunit": "Rappen",
"subunit_to_unit": 100,
"symbol_first": true,
"format": "%u%n",
"format": "%u %n",
"html_entity": "",
"decimal_mark": ".",
"thousands_separator": ",",
Expand Down
8 changes: 4 additions & 4 deletions spec/money/formatting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -750,16 +750,16 @@
end
end

describe ':format to "%u%n" for currency with :symbol_first to true' do
describe ':format to "%u %n" for currency with :symbol_first to true' do
context 'when rules are not passed' do
it "does not insert space between symbol and number" do
expect(Money.new(100_00, 'CHF').format).to eq "CHF100.00"
it "inserts a space between symbol and number" do
expect(Money.new(100_00, 'CHF').format).to eq "CHF 100.00"
end
end

context 'when symbol_position is passed' do
it "inserts currency symbol before the amount when set to :before" do
expect(Money.new(100_00, 'CHF').format(symbol_position: :before)).to eq "CHF100.00"
expect(Money.new(100_00, 'CHF').format(symbol_position: :before)).to eq "CHF 100.00"
end

it "inserts currency symbol after the amount when set to :after" do
Expand Down

0 comments on commit 85184d8

Please sign in to comment.