1

I want to show one more currencies in a page. For example

$100,000 And 100,000€

When I use $filter('currency')(100000, '€') it returns €100,000. But I want it as 100,000€ The problem is I cannot replace the symbol. Any idea ?

Oğuz Can Sertel
  • 749
  • 2
  • 11
  • 26

1 Answers1

3

You can always create a custom filter.

app.filter('customCurrency',['$filter', function(filter) {
  var currencyFilter = filter('currency');
  return function(amount, currencySymbol) {
    var value = currencyFilter(amount).substring(1);
    var currency = "";
    switch(currencySymbol) {
      case '$':
        currency = currencySymbol + value;
        break;
      case '€':
        currency = value + currencySymbol;
        break;
    }
    return currency;
  }}])

Here is the working example: http://plnkr.co/edit/IIWG18?p=preview

Ku Jin Shin
  • 117
  • 2
  • 10