Skip to content

Commit

Permalink
Document how to localize currency position format (RubyMoney#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
w0rm authored Mar 1, 2020
1 parent 6b8fbf0 commit a6bc544
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,16 @@ Money.new(10_000_00, 'USD').format # => $10.000,00
Money.new(10_000_00, 'EUR').format # => €10.000,00
```

If you need to localize the position of the currency symbol, you
have to pass it manually. *Note: this will become the default formatting
behavior in the next version.*

```ruby
I18n.locale = :fr
format = I18n.t :format, scope: 'number.currency.format'
Money.new(10_00, 'EUR').format(format: format) # => 10,00 €
```

For the legacy behaviour of "per currency" localization (formatting depends only on currency):

```ruby
Expand Down

0 comments on commit a6bc544

Please sign in to comment.