title: Converting a float to hh:mm format
body: <p>I want to print a float value that I've got after performing some math as time string in the hh:mm format. Currently I have the float like 9.888888888888886 and I want it in time like 09:50. I have tried the following code:</p>
  
  <pre><code>    time = str(time)
      time = time.split(".")
      time[1] = float(time[1])
      time[1] *= 0.6
      time[1] = str(time[1])
  </code></pre>
  
  <p>and when I print I use</p>
  
  <pre><code>    str(time[0]) + ":" + time[1][:2]
  </code></pre>
  
  <p>Any way to achieve this effect consistently? With more advanced inputs my above code does not work properly, and outputs the wrong time.</p>