Kōdo no musō-ka
Kōdo no musō-ka

Reputation: 769

AngularJS currency filter in pounds

i'm learning AngularJS and in the tutorial i'm following we had to use the currency filter, i noticed that this changes, for example 10, into $10.00.

How do i do this for English pounds?

   <p class="price">{{ product.price | currency }}</p> 

Upvotes: 4

Views: 3075

Answers (4)

Ashish Bairagi
Ashish Bairagi

Reputation: 382

You can add you symbol and fractionSize like this:

{{ currency_expression | currency : symbol : fractionSize}}

for now your solution is:

<p class="price">{{ price | currency : '£'}}</p>

More detail here

Upvotes: 0

LeRoy
LeRoy

Reputation: 4436

You Should really look at the Angularjs Documentation here

The format your looking for is

{{amount | currency:'£'}}

This tutorial discuss the currency filter in detail.

Upvotes: 1

user5741800
user5741800

Reputation:

angular currency filter take one optionnal parameter and it's the currency symbol.

With this information, your snippet will look like this :

<p class="price">{{product.price|currency:"£"}}</p>

AngualJS docs

Hope it's help

Upvotes: 5

Hassan Tariq
Hassan Tariq

Reputation: 740

   {{ price | currency:'Symbol for pound'}}

Place your symbol for pound over here in ' '

Upvotes: 9

Related Questions