AngularJS filters are used to format/transform the data displayed in the
view, filters can be used with expressions, ng-bind, ng-repeat etc and act upon
the data from the model. The currency
filter is used to format currency format display in the view
The following is the syntax for using currency filters
{{ <variable> | currency }}
The following is an example of using currency filters.
<html ng-app>
<head>
<meta charset="utf-8" />
<title>AngularJS - Basic</title>
<script src="angular.min.js"></script>
</head>
<body>
<div ng-init="amount=10000">
<p>Output :<b> {{ amount | currency }} </b></p>
</div>
</body>
</html>
Output:
The following is the syntax for using currency filters
{{ <variable> | currency }}
The following is an example of using currency filters.
<html ng-app>
<head>
<meta charset="utf-8" />
<title>AngularJS - Basic</title>
<script src="angular.min.js"></script>
</head>
<body>
<div ng-init="amount=10000">
<p>Output :<b> {{ amount | currency }} </b></p>
</div>
</body>
</html>
Output:
No comments:
Post a Comment