1app.filter('comma2decimal', [
2function() { // should be altered to suit your needs
3 return function(input) {
4 var ret=(input)?input.toString().trim().replace(",","."):null;
5 return parseFloat(ret);
6 };
7}]);
8
1app.filter('decimal2comma', [
2function() {// should be altered to suit your needs
3 return function(input) {
4 var ret=(input)?input.toString().replace(".",","):null;
5 if(ret){
6 var decArr=ret.split(",");
7 if(decArr.length>1){
8 var dec=decArr[1].length;
9 if(dec===1){ret+="0";}
10 }//this is to show prices like 12,20 and not 12,2
11 }
12 return ret;
13 };
14}]);
15