0
I am working on a MVC4 project, the mask works correctly when saved, but when returning the database data the plugin shows incorrect data if the value ends in 0.
Data example: 99.000,00
, when I go to the Edit View: 990,00
I can do a gambiarra to fix this, but as I am using MVC4, I would like to know the correct way to deal with this situation.
View:
<div class="campo">
@Html.LabelFor(model => model.ValorPadrao)
<br />
@Html.TextBoxFor(model => model.ValorPadrao, new { style = "width:400px", @class ="maskMoeda" })
</div>
Javascript call:
$('.maskMoeda').mask('999.999.999.999.999,00', { reverse: true })
.css('text-align', 'right');
Field in the Model:
public decimal? ValorPadrao { get; set; }
Because it does not ascribe to the
input
the value without formatting (double), in which case it would be "99000.00". I believe that in the mask passage it should format correctly.– Wakim
I don’t understand, you can explain better?
– Laerte
Don’t bag well of . Net, but wouldn’t have been able to assign the value without formatting to the input in the page rendering? In the case with "." as decimal separator and without "," in the thousand separator.
– Wakim