Introduction
In this article you will learn about Currency Filter in AngularJS.

AngularJs :
AngularJS is a JavaScript framework. It was originally developed by Hevery and Adam Abrons. Now it’s maintained by Google. AngularJS is lightweight and easy to learn. It is perfect in Single Page Application projects. AngularJS is open source, free of cost, and easy to handle.
AngularJS is a JavaScript framework. It was originally developed by Hevery and Adam Abrons. Now it’s maintained by Google. AngularJS is lightweight and easy to learn. It is perfect in Single Page Application projects. AngularJS is open source, free of cost, and easy to handle.
Currency Filter
One of the filters in AngularJS is the Currency Filter. This “currency” filter includes the “$” Dollar Symbol as the default. So we can use the following code as the html template format of Currency Filter.
- {{ currency_expression | currency : symbol : fractionSize}}
Html :
The following html code contains the root directory “ng-app” & Controller “ng-controller”. So you can create any name for it. The AngularJS currency filter contains the “$” Dollar symbol as default.
- <div ng-app="CurrencyApp" ng-controller="CurrencyController">
- <input type="number" ng-model="amount">
- <h2>{{ amount | currency }}</h2>
- </div>
When we run the following code you will get the result as “$1000”. So you can change this “$” Dollar symbol based on the html template format of Currency Filter.
- var myApp = angular.module('CurrencyApp', []);
- myApp.controller('CurrencyController', function($scope) {
- $scope.amount = 1000;
- });
Removing Default Symbol Of Currency Filter
Html
In the following code value=”” , So the default Symbol “$” Dollar will be removed.
- <div ng-app="CurrencyApp" ng-controller="CurrencyController">
- <input type="number" ng-model="amount">
- <h2>{{ amount | currency : value="" }}</h2>
- <!-- or-->
- <h2>{{ amount | currency : "" }}</h2>
- </div>
List Of Countries and Their Currency Using Angular Js
Html
The following code contains the currency symbol for respective countries.
- <h3>Countries & Their Currency Using AngularJS</h3>
- <div ng-app="CurrencyApp" ng-controller="CurrencyController"> <input type="number" ng-model="amount">
- <h3>
- Removed default currency($) : {{ amount | currency : "" }}
- </h3>
- <h3>
- Default currency($) : {{ amount | currency }}
- </h3>
- <h3>
- Indian Currency: {{amount | currency:"₹"}}
- </h3>
- <h3>
- US Dollar - USD : {{ amount | currency : "$" }}
- </h3>
- <h3>
- United Kingdom Pound - GBP : {{amount | currency:"£"}}
- </h3>
- <h3>
- Thailand Baht - THB : {{amount | currency:"฿"}}
- </h3>
- <h3>
- China Yuan Renminbi - CNY : {{amount | currency:"¥"}}
- </h3>
- <h3>
- Costa Rica Colon - CRC : {{amount | currency:"₡"}}
- </h3>
- <h3>
- Ukraine Hryvnia - UAH : {{amount | currency:"₴"}}
- </h3> </div>
AngularJS
- var myApp = angular.module('CurrencyApp', []);
- myApp.controller('CurrencyController', function($scope) {
- $scope.amount = 1000;
- });
Fraction Size In AngularJS Currency Filter
We can use the fraction size in the currency filter. In the following code we added 3 as the fraction size so it added 3 zeros in the result.
Html
- <h3>Fraction Size In AngularJS Currency Filter</h3>
- <div ng-app="CurrencyApp" ng-controller="CurrencyController">
- <input type="number" ng-model="amount">
- <h3>
- Amount : {{ amount | currency : "$" : 3 }}
- </h3>
- </div>
Reference
Summary
We learned how to use Currency Filter In AngularJS. I hope this article is useful for all beginners.
Read more articles on AngularJS:

Sathya SambathPosted Oct 12, 2017, 5:41 AM
Nice share and Thank you
Delpin Susai RajPosted Aug 28, 2016, 6:59 AM
Nice one
kalu singh raoPosted Jul 25, 2016, 1:48 AM
Nice share
Vivek KumarPosted Apr 9, 2016, 11:45 AM
Nice share.
Imtiyaz AnsariPosted Apr 7, 2016, 4:36 AM
Nice Description...
Gowtham RajamanickamPosted Apr 7, 2016, 3:04 AM
good one..
Vignesh ManiPosted Apr 6, 2016, 12:34 PM
Nice one
Mohammed IbrahimPosted Apr 6, 2016, 12:10 PM
nice
Debasis SahaPosted Apr 6, 2016, 10:08 AM
Good One..
Sumit AroraPosted Apr 6, 2016, 10:01 AM
Nice share...
Rahul Kumar SaxenaPosted Apr 6, 2016, 9:59 AM
Good One..