3
How to put monetary mask in a table ? For inputs I used the directive ui-money-Mask, but I need to put in a table cell.
<td>{{item.valor}}</td>
3
How to put monetary mask in a table ? For inputs I used the directive ui-money-Mask, but I need to put in a table cell.
<td>{{item.valor}}</td>
2
Use the filter
currency
To show in real format (R$) you have two options, using the 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>
<script src="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, so 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 dot 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>
<div ng-app ng-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>
Browser other questions tagged angularjs mask
You are not signed in. Login or sign up in order to post.
This already helps me, but to print in R$ xxx,xx format, how do I ? In this case, using comma instead of dot ?
– Mayllon Baumer
The archive
angular-locale
is a JSON, you can find in the file where you define the currency and add a spaceR$
or add the mask with the space directly onfilter:currency
– Pedro Camara Junior
Dude, it was worth the help.
– Mayllon Baumer