title: decimal rounding issues for exact VAT calculation
body: <p>Is there a more professional way of rendering the below long-winded, convoluted attempt to extract net values and to establish the vat amount so all is equal to the starting total (tot1)</p>
  
  <pre><code>            decimal tot1 = Convert.ToDecimal(typeA) + Convert.ToDecimal(typeB);
              decimal netTot = Math.Round(Convert.ToDecimal(tot1) / 1.2m, 2);
              decimal vat = tot1 - netTot;
              decimal netA = Math.Round(Convert.ToDecimal(typeA) / 1.2m, 2);
              decimal netB = Math.Round(Convert.ToDecimal(typeB) / 1.2m, 2);
              decimal netAA = netTot - (netA + netB);
              decimal netAAA = netAA + netA;
  </code></pre>
  
  <p>Having said that, this code works in 9 out of 10 cases. Sometimes there is a plus or minus 0.01 difference and I don't understand why</p>