title: python: showing only two decimal digits when tabulating a float
body: <p>I have written a code that parses some text documents and shows the frequence in which some words appear.</p>
  
  <p>The output is the following:</p>
  
  <pre><code>Counting words by tag
  ---------------------
  
  modals
  per 1000 words                    can  could  shall should   will  would
  austen-emma.txt                1.480000 4.350000 1.100000 1.920000 2.900000 4.260000
  austen-persuasion.txt          1.090000 4.590000 0.560000 1.920000 1.650000 3.620000
  austen-sense.txt               1.500000 4.060000 0.870000 1.640000 2.500000 3.600000
  chesterton-ball.txt            1.460000 1.210000 0.510000 0.770000 2.040000 1.440000
  chesterton-brown.txt           1.500000 1.990000 0.350000 0.650000 1.290000 1.570000
  chesterton-thursday.txt        1.760000 2.180000 0.710000 0.780000 1.570000 1.730000
  </code></pre>
  
  <p>As you can see, the numbers are rounded to hundredths, but my program still prints some excessive zeros.</p>
  
  <p>That dipends on the tabulation, that is on the following code rows:</p>
  
  <pre><code>     cell = round(float(cfdist[fileid][w])*1000/number_of_words[fileid],2)
       print '%6f' % (cell),  
  </code></pre>
  
  <p>Would someone be able to help me to improve the row print '%6f' % (cell), so that it would not show the ending zeros?</p>
  
  <p>Thanks!</p>