title: How to check whether a decimal value has no more than 2 decimal points?
body: <p>I have a method as below:</p>
  
  <pre><code>public bool IsValid(decimal rate)
  {
    // 
  }
  </code></pre>
  
  <p>The rate can be between 0.00 and 99.99 and it shouldn't contain more than 2 decimal places otherwise it should throw an exception.</p>
  
  <p>How to check whether a decimal value has no more than 2 decimal points? e.g. 99.123 is invalid whereas 99.12 is valid.,</p>