title: Javascript convert HH:MM to decimal
body: <p>I have a Javascript function that gives me the total hours worked in a day as HH:MM. I want to convert those numbers to decimals so I can add them up. I just seem to be getting errors at the moment:</p>
  
  <pre><code>function timeToDecimal(t) {
  t = t.split(':');
  return = t[0]*1 + '.' parseInt(t[1])/60;
  }    
  </code></pre>
  
  <p>Am I missing something important? I just keep getting syntax errors. </p>