2
I want to make a number directive in Angularjs with two features, one to format when typing a number in an html input.
Example of how you would like :
1,200,0000
12.000,0000
120,000,0000
and the other to limit the decimal places to 4 boxes after the comma.
Someone has an idea?
Have you tried using the
ng-currency
? Ex: http://plnkr.co/edit/u9mJqDH8UpwxDnOv8gZL?p=preview– DiegoAugusto
That’s just what I needed, but I tried it here and it didn’t work the example, I added the ng-currency script, and I have the en locale, the console does not accuse any errors, have some extra config to add?
– Geferson
Did you put the directive in your html? You stated it in the app?
– DiegoAugusto
angular.module('myApp', ['ng-currency']);
– DiegoAugusto
Perfect, I had forgotten this detail, it worked right, thank you very much.
– Geferson
Nothing, since it worked I’ll answer the question.
– DiegoAugusto