Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6930025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:23:36+00:00 2026-05-27T11:23:36+00:00

Hi i am messing around with rails, there is a method built into rails

  • 0

Hi i am messing around with rails, there is a method built into rails that can convert a decimal number into a currency. I could just change it in the view but i would like to internalize it into the application so that i can save on the maintenance.

<span class="price"><%= product.price %></span>

In my index template i have this and could change it to american dollars just like this:

<span class="price"><%= number_to_currency(product.price) %></span>

I did find several was of changing it into euro’s the rails API is great:

number_to_currency(1234567890.506, :locale => :fr) #this will change it euros/france

Now does anyone know where i could get a list for all the different areas? and there currencies? in particular South Africa(ZAR)??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:23:37+00:00Added an answer on May 27, 2026 at 11:23 am

    To change the currency you just have to specify it like this:

    <span class="price"><%= number_to_currency(product.price, :unit => "R") %></span>
    

    Then to make it cohesive, you would have to write a short math sum to preform the conversions, and just have a file update with the daily exchange rates that are then loaded into the sum.

    I should have researched this a little more thanks for the comments

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just messing around with Rails 3.1, which separates stylesheets via controllers. I'm assuming there
Im just messing around with Ruby on Rails and HTML. This question isn't about
I am just messing around with an app that streams audio and I wanted
I'm messing around with rails and hope to try some different image manipulation techniques.
Using Ruby 1.8.6 / Rails 2.3.2 I am noticing that any method called on
I am messing around with Railscast #102 Auto-Complete Association in a Rails 3.1 app,
Is there a way in Rails 3 to call an action (to play around
I'd just started toying around with Ruby on Rails and had come across an
I was messing around with LinqToSQL and LINQPad and I noticed that SingleOrDefault() doesn't
just messing around, trying to expand my bag o' tricks: I was just experimenting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.