How to get specific currency symbol(rupee symbol in my case) in angular js instead of the default one (dollar $ symbol) How to get specific currency symbol(rupee symbol in my case) in angular js instead of the default one (dollar $ symbol) jquery jquery

How to get specific currency symbol(rupee symbol in my case) in angular js instead of the default one (dollar $ symbol)


To display currency symbol in angular js you need provide HTML entity for currency symbols below are the examples and usage in through code and in template :

Inside your Template example of Euro:

Item Price<span style="font-weight:bold;">{{price | currency:""}}</span>

example of Rupee:

Item Price<span style="font-weight:bold;">{{price | currency:"&#8377;"}}</span>

Also check below url

http://www.cs.tut.fi/~jkorpela/html/euro.html

From controller :

Inject $filter in your controller

$scope.price=$filter('currency')($scope.price,'€')


You can use the symbol parameter:

Item Price<span style="font-weight:bold;">{{item.price | currency[:symbol]}}</span>

Exemple:

Item Price<span style="font-weight:bold;">{{item.price | currency:"USD$"}}</span>

Please refer to this:

http://docs.angularjs.org/api/ng.filter:currency


I'm late to the party but worked on this filter for my last project.

if you have the ISO 4217 currency code (3 chars length e.g. USD, EUR, etc) isoCurrency can output the right format, fraction size and symbol.

// in controller$scope.amount = 50.50;$scope.currency = 'USD';// in template{{ amount | isoCurrency:currency }} // $50.50