This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Initial Referance taken from https://gist.github.com/thewarpaint/889690aeb21a8dfd7aba and modified as per the requirement.*/ | |
angular.module('Utils',[]).filter('isoCurrencyWithK', ["$filter", "iso4217", function ($filter, iso4217) { | |
return function (amount, fraction, currencyCode) { | |
var exp = 0, rounded, currency, nagative, suffixes = ['','K', 'M', 'G', 'T', 'P', 'E']; | |
//set decimal amount. Default 0 | |
var fractionSize = fraction === void 0 ? 0 : fraction; | |
//check if the amount is more than 1000 | |
//if yes, set suffix for the amount | |
if(amount >= 1000 || amount < -1000 ) { |