Change Angular Real Mask 2

1

I have a field with value formatted with currency 'BRL': true: '2.0-0'. The value it brings me is this way: R $ 500,000,000. I would like to know how I can leave it as follows: 500,000,000.

    
asked by anonymous 22.03.2017 / 21:36

1 answer

1

I advise you to use a transform filter for your variable.

 angular.module("seuAPP").filter("nomedofiltro", function () { 
    return function (input) { 
        if (input.length <= 3) return input; 
        var output = input.substring(0,3)+ "."; 
        return output; 
    }; 
 }); 

With this function above you will include the first point, just complete the other cases when you have 7 characters and so on.

on the screen just use it this way:

{{ suavariavel | nomedofiltro }}
    
28.07.2017 / 15:40