title: C# mvc 5 Data Annotation Restrict Numbers After Decimal point
body: <p>I have model like</p>
  
  <pre><code>public class Invoice
  {
      int  Invoice Number{get;set;}
  
      [DisplayFormat(DataFormatString = "{0:n2}", ApplyFormatInEditMode = false)]
      public float ReceivedAmount { get; set; }
  }
  </code></pre>
  
  <p>In view Page, the <code>ReceivedAmount</code> is accepting many numbers after Dot like
  500.25251, but i want 500.25<br></p>
  
  <blockquote>
    <p>It should prevent from entering the value in the field. Not show error message</p>
  </blockquote>
  
  <p>Thanks in advance</p>