4

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> 

4 Answers 4

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

Place your symbol for pound over here in ' '

Sign up to request clarification or add additional context in comments.

Comments

5

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

Comments

1

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.

1 Comment

I have now found the documentation, thank you very much, I shall read through carefully.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.