I have a quick question, more theory then actual code. I am building a small program that will interact with activeCollab. Anyways, I want to store the value of a quote in canadian dollars but I want to also be able to view it as USD as well. My question is, should I create a field to store the american price or should I use some sort of javascript to show the conversion on the fly (with the use of a button or something). Has anyone come across the same sort of is开发者_StackOverflowsue before?
Thanks everyone.
Steve
As the currency rates change, you should either do it via javascript or (I would recommend) doing it in your view function. Storing it in a database would not make much sense, as the conversion rates change from day to day, and every time they changed, you would have to update the values in the database. If data is likely to change regularly, and can be easily generated dynamically, then that is the best option.
精彩评论