How to put mask on table with angle?

2

How to put a monetary mask on a table? For the inputs I used the ui-money-mask directive, but I need to put it in a table cell.

<td>{{item.valor}}</td>

    
asked by anonymous 11.12.2015 / 13:57

1 answer

2

Use filter currency

To show in real format ($) you have two options, using Angular Locale , see Using Locale in AngularJS

<!--Utilizando o Angular Locale-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js"></script><scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/i18n/angular-locale_pt-br.js"></script>

<div ng-app ng-init="valor='85.41'">
  <input ng-model="valor" />
  <!--Máscara default utilizando o locale - (R$xx,xx).-->
  <p>{{valor | currency}}</p>
  <!--Você pode alterar o símbolo da moeda como preferir - (R$ xx,xx).-->
  <p>{{valor | currency:'R$ '}}</p>
</div>

Or you can enter an identifier in the filter, in this way, it will only show the identifier you enter (R $ for example), but in this way (without using the locale) the decimal separator will be the English standard with a point and not a comma as in the Brazilian format.

<!--Sem o Angular locale-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.1/angular.min.js"></script><divng-appng-init="valor='85.41'">
  <input ng-model="valor" />
  <!--Máscara Default sem o locale - ($xx.xx).-->
  <p>{{ valor | currency }}</p>
  <!--Máscara formatada sem o locale - (R$xx.xx).-->
  <p>{{ valor | currency: 'R$' }}
</div>
    
11.12.2015 / 14:04