title: What's the best rounding_method for Ruby Money gem?
body: <p>We're using Ruby's Money gem. In our application, we're also converting between currencies.</p>
  
  <p>So the issue of rounding comes up when you convert between currencies. Currently we're using the Ruby's built-in <a href="http://www.ruby-doc.org/core-1.9.3/Float.html#method-i-round" rel="nofollow"><code>Float#round</code></a>.</p>
  
  <p>However, this introduces "the dangling penny" problem.</p>
  
  <pre><code>Money.new(500,'USD').exchange_to('EUR')
  #=&gt; #Money cents:385 currency:EUR
  
  Money.new(500,'USD').exchange_to('EUR').exchange_to('USD')
  #=&gt; #Money cents:501 currency:USD
  </code></pre>
  
  <p>So $5.00 becomes $5.01 after converting to Euro and then back! These are the exchange rates we're using:</p>
  
  <pre><code>{
    "GBP_TO_USD"=&gt;1.6,
    "USD_TO_GBP"=&gt;0.625,
    "GBP_TO_EUR"=&gt;1.2,
    "EUR_TO_GBP"=&gt;0.8333333333333334,
    "EUR_TO_USD"=&gt;1.3,
    "USD_TO_EUR"=&gt;0.7692307692307692
  }
  </code></pre>
  
  <p>Is it possible to have a rounding method to avoid this problem of an extra or missing penny?  What would that rounding method be?</p>
  
  <p>Or is this a mathematically insoluble problem?</p>