I have a collection named Sites like this:
{ site: "a", price: 100, currency: USD } { site: "b", price: 70, currency: EUR } { site: "c", price: 300, currency: CNY }
In my template I have:
{{#each sites}}
{{site}}
{price}}
{{/each}}
My helper does this:
Template.prices.sites = function() { return Sites.find(); };
The user is given a select option and I want to be able to show prices in a single currency according to the selection.
So If the user selects EUR, the price of the item: { site: "a", price: 100, currency: USD } will be displayed as price * eur_usd_exchange_rate
I can do this by creating individual template variables for each item and creating a different helper for each.
But I want to be able to use a single helper. How can I do this?