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
angular.module('app').filter 'round', () -> | |
(input, decimals) -> | |
return Math.round(input * Math.pow(10, decimals)) / Math.pow(10, decimals) |
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
/** | |
* loop through flattened array and return whole object or value to specified key | |
* e.g. array: [{"idKey": 1, "otherKey": "hello"}, | |
* {"idKey": 2, "otherKey": "world"}] | |
* @param arr | |
* @param key search for this key | |
* @param value match searched key's value to desired value | |
* @param {string=} keyToReturn return value of this key | |
* @returns {*} | |
*/ |
NewerOlder