A simple angular filter for displaying an exchange rate properly depending on its value
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 install --save angular-xrate
and make sure that
angular.module('yourAppName', ['xrate']);
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.