Doubt with decimal numbers asp.net mvc

-1

I have a register, where I have some fields to insert values, but the same is only accepting integer, if you add some value with zero decimal.

Controller

    [Display(Name = "Valor Multiplicador para Opção 01:")]
    [DisplayFormat(DataFormatString = "{0:0,0.00}", ApplyFormatInEditMode = true)]
    public double VALOR01 { get; set; }

View

<!-- language: lang-html -->    
 @using (Html.BeginForm("Index", "CadastroPossibilidade", FormMethod.Post))
 {

     <div class="row">
        <div class="container">

           <div class="col-md-3 form-group">
                @Html.HiddenFor(c => Model.IDPOSSIBILIDADE)
                @Html.LabelFor(c => Model.DESCRICAO01)
                @Html.TextBoxFor(c => Model.DESCRICAO01, new { placeholder = "descrição", @class = "form-control" })

           </div>

           <div class="col-md-3 form-group">
                @Html.LabelFor(c => Model.VALOR01)
                @Html.TextBoxFor(c => Model.VALOR01, new { placeholder = "0", @class = "form-control" })

           </div>


           <div class="col-md-3 form-group">
                @Html.LabelFor(x => x.IDTITULOPOSS)
                @Html.DropDownListFor(x => x.IDTITULOPOSS, ViewBag.TituloPos as SelectList, new { @class = "form-control" })
                @Html.ValidationMessageFor(x => x.IDTITULOPOSS)
           </div>

      </div>
    </div>
 }
    
asked by anonymous 02.08.2016 / 00:42

1 answer

0

I made the change to

<div class="col-md-3 form-group">
<label>Multiplicador 01:</label>
<input class="form-control input-sm" autocomplete="off" type="number" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" step="0.01" id="valor1" name="valor1">
</div>
    
02.08.2016 / 02:22