title: Problem getting the MVC3 model binder to bind to a decimal instead of an int
body: <p>I have a AJAX call from my webpage sending the following data to my MVC3 action method.</p>
  
  <pre><code>{
    "name":"Test",
    "newitems":[
      {"id":15,"amount":100,"unit":"gram"},
      {"id":1,"amount":75,"unit":"gram"},
      {"id":46,"amount":25,"unit":"gram"}
    ]
  }
  </code></pre>
  
  <p>In my controller I have the following classes:</p>
  
  <pre><code>public class NewDataItem
  {
    public string name { get; set; }
    public List&lt;NewDataItemDetails&gt; newitems { get; set; }
  }
  
  public class NewDataItemDetails
  {
    public int id { get; set; }
    public int amount { get; set; }
    public string unit { get; set; }
  }
  </code></pre>
  
  <p>And the Action method that received the request have a <code>NewDataItem</code> as a parameter. This works perfect, however the amount property of NewDataItemDetails might not always contain an int. It might for example be 50.45. So because of that I changed the line <code>public int amount { get; set; }</code> to <code>public decimal amount { get; set; }</code>.</p>
  
  <p>After this change amount is always shown as 0, and not the proper value that it did when it was an int. </p>
  
  <p>Why does MVC fail to bind the value to the property when it is a decimal, when it worked just fine as an int?</p>