title: How to delete trailing zeros after the 3rd decimal place in PHP?
body: <p>thanks in advance.</p>
  
  <p>I have a WP WooCommerce store and need to upload some prices that have 3 decimal places, e.g. £0.012 (products that are purchased in volumes of 000s).</p>
  
  <p>The majority of my products are 'ordinary' with 2 decimal places. </p>
  
  <p>There is a function in WooCommerce that allows for 3 decimal places - fine. Also a function to delete trailing zeros, but it deletes them if it's an integer e.g. £10.00 becomes £10.</p>
  
  <p>My problem arises when the 95% of 'ordinary' price products start showing £10.000 or £5.230.</p>
  
  <p>In a nutshell I'm looking for a way to delete trailing zeros but ONLY after the 3 decimal place;</p>
  
  <p>Retain - £0.012
  Delete any 3rd decimal 0 on prices like £10.00 or £5.23</p>
  
  <p>Does anyone have a good solution?</p>
  
  <p>Thanks</p>