title: How to round a Python Decimal to 2 decimal places?
body: <p>I've got a python Decimal (a currency amount) which I want to round to two decimal places. I tried doing this using the regular round() function. Unfortunately, this returns a float, which makes it unreliable to continue with:</p>
  
  <pre><code>&gt;&gt;&gt; from decimal import Decimal
  &gt;&gt;&gt; a = Decimal('1.23456789')
  &gt;&gt;&gt; type(round(a, 2))
  &lt;type 'float'&gt;
  </code></pre>
  
  <p>in the decimal module, I see a couple things in relation to rounding:</p>
  
  <ul>
  <li>ROUND_05UP</li>
  <li>ROUND_CEILING</li>
  <li>ROUND_DOWN</li>
  <li>ROUND_FLOOR</li>
  <li>ROUND_HALF_DOWN</li>
  <li>ROUND_HALF_EVEN</li>
  <li>ROUND_HALF_UP </li>
  <li>ROUND_UP</li>
  <li>Rounded</li>
  </ul>
  
  <p>I think that none of these actually give what I want though (or am I wrong here?).</p>
  
  <p>So my question: does anybody know how I can reliably round a Python Decimal to 2 decimal places so that I have a Decimal to continue with? All tips are welcome!</p>