title: DropDownListFor not selecting with decimal values
body: <p>I'm working with ASP.NET MVC 5 and Entity Framework 6, and I'm having a problem with the model selected value (only for decimal values) in my views.</p>
  
  <p>That only happen when i'm getting data from database, if i try to submit the form, the value get back and is correctly selected.</p>
  
  <p>This is my ViewModel</p>
  
  <pre><code>public class Regulacion
  {
          public IEnumerable&lt;SelectListItem&gt; ListaPorcentajePuntos 
          {
                  get
                  {
                          return new List&lt;SelectListItem&gt;
                          {
                                  new SelectListItem { Text="0,625%" , Value = "0,625"},
                                  new SelectListItem { Text="1%" , Value = "1"},
                                  new SelectListItem { Text="1,25%", Value="1,25" },
                                  new SelectListItem { Text="2,5%" , Value = "2,5"},
                                  new SelectListItem { Text="5%" , Value = "5"},
                          };
                  }
          }
  
          public decimal? PorcentajePunto { get; set; }
          //other stuff 
  
          public Regulacion(Reg reg)
          {
              PorcentajePunto = reg.PorcentajePunto; 
          }
  
  }
  </code></pre>
  
  <p>And i'm using it in the view like this</p>
  
  <pre><code>@Html.DropDownListFor(x =&gt; x.PorcentajePunto, Model.ListaPorcentajePuntos, "Please select", new { @class = "form-control"})
  </code></pre>
  
  <p>I'm pretty sure, the problem become when i fetch the data from EF and decimal precision, because, when I'm debugging, the <code>PorcentajePunto</code> property stored <code>5.00</code> instead of <code>5</code>, if i manually modify the property to <code>5</code> it works perfectly.</p>
  
  <p>I read <a href="https://stackoverflow.com/questions/16799476/mvc-dropdownlistfor-not-selecting-value-from-model">this</a> question and try to use <code>SelectList</code> instead of <code>SelectListItem</code> but wasn't the solution</p>
  
  <p>How can i deal with it?</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>I'm fetching the <code>Regulacion</code> data like this</p>
  
  <pre><code>using(var db = new DBTrafosContext())
  {
     var a = db.Reg.FirstOrDefault();
     if(a != null){
         Regulacion newRegulacion = new Regulacion(a);
     }
  }
  </code></pre>