I'm working on an MVC4 project, the mask works correctly when saved, but when returning the database data the plugin shows incorrect data if the value ends at 0.
Data example: 99.000,00
, when I go in the Edit View it gets: 990,00
I can do a trick to fix this, but since I'm using MVC4, I'd like to know how to handle this situation.
View:
<div class="campo">
@Html.LabelFor(model => model.ValorPadrao)
<br />
@Html.TextBoxFor(model => model.ValorPadrao, new { style = "width:400px", @class ="maskMoeda" })
</div>
Call Javascript:
$('.maskMoeda').mask('999.999.999.999.999,00', { reverse: true })
.css('text-align', 'right');
Field in Model:
public decimal? ValorPadrao { get; set; }