title: Magento 1.9.1 Rounding Issues
body: <p>i have been spending the last 2 weeks trying to solve rounding issues on my magento installation, i have already searched on google, i have already read all the posts here on stackoverflow but nothing seems to help.</p>
  
  <p><a href="https://i.stack.imgur.com/azhdN.png" rel="nofollow">This is where rounding error occur</a></p>
  
  <p>As you can see in the image we have: </p>
  
  <ul>
  <li>total: 308,72€</li>
  <li>total with tax (iva 22%): 376,63€</li>
  <li>total expected: 308,72*1,22 = 376.6384, with rounding UP: 376,64€</li>
  <li>so tax is 1 cent less, which is a big problem</li>
  <li>the problem seems to appear in a random way, i couldn't find any patterns or condition which cause this issue.</li>
  </ul>
  
  <p>Here some info about the environment:</p>
  
  <ul>
  <li>Magento version 1.9.1 (still need to update to SUPEE-8788)</li>
  <li>CoolBaby Theme (latest version)</li>
  <li>Plugin used: </li>
  <li>1)PHOENIX Magento-CashOnDelivery</li>
  <li>2)Extendware: Full Page Cache</li>
  <li>3)Extendware: Minify css/js</li>
  <li>Mysql Version: 5.6.33</li>
  <li>Php Version: 5.5</li>
  </ul>
  
  <p>Here are some solutions and config combination i have already tryed:</p>
  
  <ul>
  <li>Disable all plugins</li>
  <li>Change the roundPrice function to 4 decimal instead of 2</li>
  <li>Creating a new magento 1.9.1 installation using the same db</li>
  <li>Changing calculation mode, none of the 3 options resolve the problem, actually the best method seems to be "Total"</li>
  <li>Changing "Price include taxes" in calculation mode config</li>
  <li>Changing Cash on Delivery fee include tax</li>
  <li>Changing Shipping Cost include tax</li>
  </ul>
  
  <p>In my catalogue i have a lot of products with very small price but the problem appear also when all prices have only 2 decimal. </p>
  
  <p>A strange fact is this: in the example i have COD which is 10€ with vat included, if i remove COD and i add a product with the same price (10€ with vat), the total with taxes is correctly rounded to 376,64€</p>
  
  <p>Maybe i'm missing something, i don't know, i'm not so expert with magento, but i really don't know what to check now, any advices or idea will be appreciated</p>