Coefficients transit and display on UI

This commit is contained in:
nemunaire 2017-01-16 13:09:31 +01:00
parent 78ce24f3f7
commit b42016c74a
7 changed files with 64 additions and 20 deletions

View file

@ -69,3 +69,15 @@ angular.module("FICApp")
return (Math.round(res * 100) / 100) + " " + units[unit];
}
})
.filter("coeff", function() {
return function(input) {
if (input > 1) {
return "+" + Math.floor((input - 1) * 100) + " %"
} else if (input < 1) {
return "-" + Math.floor((1 - input) * 100) + " %"
} else {
return "";
}
}
})