AngularJS Tutorial - Format a String With a Currency Filter for Euro








The following code shows how to format a String With a Currency Filter for Euro.

Example


<!doctype html>
<html ng-app>
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.js"></script>
    <script src="http://code.jquery.com/jquery.min.js"></script>
  </head><!--   ww w .  j a  va2s  . c o  m-->
  <body ng-app>
    <input type="text" ng-model="amount" placeholder="Enter amount"/>
    <p>Default Currency: {{ amount | currency }}</p>
    <p>Custom Currency: {{ amount | currency: "Euro ?" }}</p>
  </body>
</html>

The code above is rendered as follows: