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?
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?
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 : "€"}}