Skip to content
/ xrate Public

A simple angular filter for displaying an exchange rate properly depending on its value

License

Notifications You must be signed in to change notification settings

Carnid/xrate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xrate

A simple angular filter for displaying an exchange rate properly depending on its value

Getting Started

You can either copy the code from src/xrate.js and add to your directive because a bower package for an angular filter might be overkill or...

Bower

bower install --save angular-xrate

and make sure that

angular.module('yourAppName', ['xrate']);

Usage

Quite simple, use it as any filter:

<h4>{{myController.myExchangeRate | xrate}}<h4> 

There are currently no additional options. Formatting follows these rules:

  • >=5000: no decimals
  • >= 80 and < 5000: two decimals
  • >= 20 and < 80: three decimals
  • >=1 and < 20: four decimals
  • < 1: six decimals

These rules are based off of wikipedia, who mentionned this is how they were traditionally displayed.

About

A simple angular filter for displaying an exchange rate properly depending on its value

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published