title: Formatting output to a fixed precision in Python
body: <p>I would like to have always 5 numbers after coma.</p>
  
  <p>Example : 
  My data is like 105.56565  105. 165.54......</p>
  
  <p>I want the same length like this: 105.56565 105.00000 165.54000....</p>
  
  <p>script :</p>
  
  <pre><code>from pylab import*
  from rtlsdr import*
  from bluetooth import*
  import sys
  
  #configure device
  sdr= RtlSdr()
  sdr.sample_rate=double(sys.argv[3])
  sdr.gain=double(sys.argv[2])
  sdr.center_freq=double(sys.argv[1])
  
  #Bluetooth connection
  
  server_sock=BluetoothSocket(RFCOMM)
  server_sock.bind(("",PORT_ANY))
  server_sock.listen(1)
  
  port=server_sock.getsockname()[1]
  uuid="94f39d29-7d6d-437d-973b-fba39e49d4ee"
  client_sock,client_info=server_sock.accept()
  
  while(1):
          samples=sdr.read_samples(256*1024)
          result=psd(samples,NFFT=1024, Fs=sdr.sample_rate/1e6, Fc=sdr.center_freq*1e6/1e6)
          freq=result[1]/1e6
          value_freq=str(freq)[1:-1]
          print format(freq, '%5f') // he do not work
  </code></pre>