How to format the Currency Filter in Angular.js?

0

I am using the currency filter in angular.js to display the price of a product, the code and the result it gives me is as follows:

{{ item.precio | currency  }}

result:

$15,000.00

How can I format the currency filter to eliminate cents?

    
asked by Daniel Enrique Rodriguez Caste 21.03.2017 в 16:44
source

1 answer

3

Just put:

 {{ item.precio | currency:undefined:0 }}

If you want 3 decimals, you put 3 , etc ...

You can change undefined for the currency you want (you can go behind):
ex:

 {{ item.precio | currency: 0 : "€"}}
    
answered by 21.03.2017 / 16:48
source