Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

When i use 'currency' in angular js, I am getting a dollar symbol. How to get required currency symbols based on the requirements. As if now i need to know how to display a rupee symbol using currency. It will be of great use if anyone could explain how to make use of this currency for different symbols at the times of different requirements.

sample :

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

If my item.price is 200. Here it shows 200$. I need to display rupee symbol instead of dollar.

like image 800
Ebenezar John Paul Avatar asked Sep 04 '13 11:09

Ebenezar John Paul


People also ask

How can I get Indian rupee symbol?

The Union government, preferring the keyboard combination mode to a key dedicated to the symbol, has shortlisted two command options to get the rupee symbol: Alt+R and Alt+4.

How do you type the generic currency symbol?

123 key in the lower-left corner of the keyboard. In the second row of numbers and symbols, press and hold your finger on the dollar-sign key. Above your finger, a box will pop up showing several currency symbols; these include the peso, the euro, the cent sign, the pound sterling and the yen.

Which AngularJS filter formats a number to a currency format?

AngularJS currency Filter The currency filter formats a number to a currency format. By default, the locale currency format is used.


1 Answers

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:"&euro;"}}</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,'&euro;') 
like image 123
JQuery Guru Avatar answered Oct 06 '22 04:10

JQuery Guru