title: Accounting system - MySQL and PHP precision
body: <p>I'm building a kind of accounting system with PHP and MySQL. My database has <code>DECIMAL (11,2)</code> columns for currency, and also <code>DECIMAL</code>for all other values used on operations with currency (like percentages to be applied). I've never programmed something like that before, so I am not sure I am doing the right thing.</p>
  
  <p><strong>Am I using the correct level of precision at the database?</strong></p>
  
  <p>On the PHP side: </p>
  
  <p><strong>Should I use BC Math functions on any values that may be later stored on the database?</strong></p>
  
  <p>I also have to format the money values with <code>,</code> as the decimal point, and <code>.</code> as the thousands separator. I know <code>number_format</code>, and recently discovered <code>money_format</code>, but the manual says both operate with floats.</p>
  
  <p><strong>Can I use <code>number_format</code> or <code>money_format</code> for values that will be displayed, or exported to CSV or Excel?</strong></p>