discourse-subscriptions/assets/javascripts/discourse/helpers/format-currency.js.es6

23 lines
432 B
Plaintext
Raw Normal View History

export default Ember.Helper.helper(function(params) {
let currencySign;
2019-10-30 23:35:19 -04:00
2019-11-30 00:39:28 -05:00
switch (params[0]) {
case "EUR":
case "eur":
currencySign = "€";
break;
case "GBP":
case "gbp":
currencySign = "£";
break;
case "INR":
case "inr":
currencySign = "₹";
break;
2019-10-30 23:35:19 -04:00
default:
currencySign = "$";
2019-10-30 23:35:19 -04:00
}
return currencySign + params.map(p => p.toUpperCase()).join(" ");
});