title: python decimals - rounding to nearest whole dollar (no cents) - with ROUND_HALF_UP
body: <p>I'm trying to use <code>Decimal.quantize()</code> to achieve the following: -</p>
  
  <p>For any amount of money, expressed as a python decimal of default precision, I want to round it using <code>decimal.ROUND_HALF_UP</code> so that it has no cents after rounding.</p>
  
  <p>For example, given 1.25, I'm trying to obtain 1.00 (signifying no cents)</p>
  
  <p>given 1.49 I'm trying to obtain 1.00</p>
  
  <p>given 1.50 I'm trying to obtain 2.00</p>
  
  <p>given 1.87 I'm trying to obtain 2.00</p>
  
  <p>given 2.00 I'm trying to obtain 2.00</p>
  
  <p>So there are two ranges for the cents -- 0 cent to 49 cents; and 50 cents to 99 cents. For cents upto 49, I want to round down, for cents 50 and up I want to round up. I'm trying to obtain the result with two significant decimal places (which will always be 00). </p>
  
  <p>I don't have any negative values to deal with here. How do I round my dollars to get the amount I want? Also is there any other option other than <code>quantize</code>?</p>