title: Storing currency values in MySQL database
body: <p>This question has been asked many times before, but I've found conflicting opinions on the topic so I thought I would bring it up again in hopes of a more unified conclusion.</p>
  
  <p>I would like to store a currency value in my database. Let's assume all entries are the same type of currency (USD for example) and that both positive and negative values are allowed.</p>
  
  <p>My initial thought would be to store the value as a signed integer in terms of the smallest unit of the associated currency. For example, if I want to store the value $1.25, I would insert <code>125</code> into the database, since the smallest unit of USD is $0.01. The nice thing about this method is that MySQL will automatically round to the nearest integer. For example, if the dollar value is $1.259, I could insert <code>125.9</code>, which would automatically be rounded and stored as <code>126</code> or $1.26.</p>
  
  <p>So, what do you think? Is this a sound approach or is there a better way?</p>