'How to set locale for just currency

The Rails Guide for i18n suggests the following to se the locale which works great

around_action :switch_locale

def switch_locale(&action)
  locale = params[:locale] || I18n.default_locale
  I18n.with_locale(locale, &action)
end

With the rails-i18n gem that lets us call number_to_currency and it does a great job of giving the currency in the proper locale. Is there a way to set locale just for number_to_currency? Then someone could choose a different language but still have number_to_currency in the en locale and vice versa.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source