From a6bc5441ca1225481976243c8e93d70f8b1667c3 Mon Sep 17 00:00:00 2001 From: Andrey Kuzmin Date: Mon, 2 Mar 2020 00:49:23 +0100 Subject: [PATCH] Document how to localize currency position format (#919) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index cb8ee0a014..63302201e3 100644 --- a/README.md +++ b/README.md @@ -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