1
I have a field, price sale, that model is like this:
public decimal PrecoVenda { get; set; }
In Viewmodel he is like this:
[Display(Name = "Preço de Venda")]
[Required(ErrorMessage = "O campo {0} é obrigatorio.")]
public decimal PrecoVenda { get; set; }
And this is View:
<label asp-for="PrecoVenda" class="col-md-2 control-label"></label>
<div class="col-md-2">
<input asp-for="PrecoVenda" class="form-control" placeholder="Insira o preço de venda.">
<span asp-validation-for="PrecoVenda" class="text-danger"></span>
</div>
But when filling the values with comma, for example "0.00" He returns this message to me:
The field Sale Price must be a number.
If I put "25.00", when checking the value is "2500,00"
Try adding this annotaton date: [Datatype(Datatype.Currency)]
– Joao Paulo
Same thing happens, same mistake occurs.
– Mariana