title: Split decimal variable into integral and fraction parts
body: <p>I am trying to extract the integral and fractional parts from a decimal value (both parts should be integers):</p>
  
  <pre><code>decimal decimalValue = 12.34m;
  int integral = (int) decimal.Truncate(decimalValue);
  int fraction = (int) ((decimalValue - decimal.Truncate(decimalValue)) * 100);
  </code></pre>
  
  <p>(for my purpose, decimal variables will contain up to 2 decimal places)</p>
  
  <p>Are there any better ways to achieve this?</p>