title: rounding float up $.01 in python
body: <p>I am working on a program that stores numbers as floats which I eventually write to a file as currency.  I am currently using the round() function to round it to 2 decimals, but the business area would like me to round to the next penny no matter what the third decimal is.  For example: </p>
  
  <pre><code>x = 39.142
  </code></pre>
  
  <p>In this case I am trying to get x to round up to 39.15.  Obviously when I do the round function I get 39.14...</p>
  
  <pre><code>&gt;&gt;&gt; round(x, 2)
      39.14
  </code></pre>
  
  <p>Is there a way I can always round up to the next penny?  I should mention that the numbers I am dealing with are printed to the file as currency.</p>