title: Force python to print a certain number of decimal places
body: <p>I have a python program which takes some floating type values and writes to a file.</p>
  
  <p>I round these numbers to 6 decimal places and then convert to a string type before writing to file.</p>
  
  <pre><code>file.write(str(round(value,6)))
  </code></pre>
  
  <p>However with certain numbers the value written to file is in the format shown below.</p>
  
  <pre><code>e.g. 3e-06 or 4e-03
  </code></pre>
  
  <p>How can I avoid this and instead write out in decimal format like</p>
  
  <pre><code>0.000003 and 0.004000
  </code></pre>
  
  <p>How can I print exactly 6 figures after the decimal point.</p>