It displays the currency symbol. The symbol can be present in some character or text and it is optional.
fractionsize
number
To round the decimal places in the amount.
Sample coding for currency Filter:
Tryit<!DOCTYPE html><html><head><title>Wikitechy AngularJS Tutorials</title><scriptsrc="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.6/
angular.min.js"></script></head><body><divng-app=""><h1>currency filter with example</h1><p>The value is $ Symbol: {{ 200*50 | currency : $}}</p><p>The value in "Nok" Symbol : {{ 105+10 | currency : "NOK" }}</p></div></body></html>
currency filter in AngularJS:
<p>The value is $ Symbol: {{ 200*50 | currency : $}}</p><p>The value in "Nok" Symbol : {{ 105+10 | currency : "NOK" }} </p>
The multiplication and addition value will be displays with currency symbol.
Code Explanation for currency Filter:
The ng-app specifies the root element (<div>) to define AngularJS application.
The expression 200*50 executed and the output will be displayed with $ symbol in <p> tag.
The expression 105+10 executed and the output will be updated “NOK” symbol in <p> tag.
Sample output:
The output displays the multiplication of two numbers with $ symbol
The output displays the addition of two numbers with “NOK” symbol.
AngularJS Filters list:
Filter
Description
currency
It is used to formats a number as a currency(i.e $589) Current Locale is the default symbol.