I'm using the jquery.inputmask plugin for various mask types in the imputs of my application and even for formatting coins .
I'm using the following custom rule:
<script>
$(function() {
$("#money").inputmask('decimal', {
'alias': 'decimal',
'radixPoint': ','
'groupSeparator': '.'
'autoGroup': true,
'digits': 2,
'digitsOptional': false,
'rightAlign': false
'placeholder': '0'
});
</script>
With very specific values it works fine, for example: R$ 2.500,50
.
With rounded values, for example: R$ 2.000,00
(when retrieving DB data) the mask is exchanging the period with the comma and returning a value R$ 2,00
.
Has anyone managed to work around this problem for currencies in Real?