title: converting time string from hhmm to hh:mm format in javascript
body: <p>I would like to convert a time string which is in hhmm format to hh:mm format, for e.g</p>
  
  <p>"230" would become "2:30"</p>
  
  <p>"400" would become "4:00"</p>
  
  <p>I did the following</p>
  
  <pre><code>var timeString = "200";
  
  var finalString = "" 
              + (((parseInt(timeString)) 
              - ((parseInt(timeString))%100))/100) 
              + ":" 
              + ((parseInt(timeString)%100)? (parseInt(timeString)%100) :"00");
  </code></pre>
  
  <p>It works, but is there a better way?</p>
  
  <p>EDIT:</p>
  
  <p>1) what if "400" should be converted to "04:00"?</p>