Skip to content

AngularJS filter that retrieves currency symbols according to ISO 4217 currency codes.

License

Notifications You must be signed in to change notification settings

moneytree-doug/isoCurrency

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

isoCurrency

AngularJS filter that retrieves currency symbols according to ISO 4217 currency codes.

Installation

  • bower install iso-currency
  • add 'isoCurrency' to your angular.module dependency, usually in app.js

Demo

http://jsfiddle.net/nqf0ye00/1/

Usage

Instead of directly using the currency symbol, you only need the 3 char long currency code (e.g. USD or JPY). It will take the right symbol, format and fraction size. The latter can be overridden by providing an explicity fraction size value after the currency field (see below).

// in controller
$scope.amount = 50.50;
$scope.currency = 'USD';

// in template
{{ amount | isoCurrency:currency }} // $50.50
{{ amount | isoCurrency:currency:0 }} // $50

About

AngularJS filter that retrieves currency symbols according to ISO 4217 currency codes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 91.1%
  • HTML 8.9%