Skip to main content
Ask A Question
Notifications
You’re not receiving notifications from this thread.
Subscribe

Changing currency

Rails • Asked by Alan Reid

I would like to change the currency in my app for each site.

So i currently have number_to_currency(aNumber, :locale => :gb) which works well. I have a number of sites which use different currencies and have their country set in @sites.currency - this passes in gb, eu, us, vi for example.

How would i go about changing the :locale => :fr to :locale => :gb as currently i can only get it passing in as a string, which is not obviously valid.


@sites.currency.to_sym should work. 👍


@sites.currency.downcase.to_sym worked a treat buddy, thanks :)


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 30,005+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.