On May 2, 1:44 pm, 7stud -- <[email protected]> wrote: > ... > <span><%= number_to_currency(product.price) %</span> > -------- > > Wt?? How does that solve any maintenance issues. If I later want to > change the view to display a different format, what's the difference > between having to change the parameters of number_to_currency() > everywhere it appears vs. changing the format of sprintf()?
Well rather than having format strings spread all over the place, you centralized the concept of formatting a number in one place, the number_to_currency method. If you wanted to change currency formatting you'd just have to change that one helper. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

