title: Convert time to a float
body: <p>I've got a stopwatch app that stores the times in an array. The JS counts milliseconds from when the timer is started, then converts those milliseconds into seconds and minutes, and outputs that as a string. </p>
  
  <p>What I'm trying to do is calculate the averages of these times, so I have to convert the strings into floats. It can convert a string like 10.35 to a float just fine, but it obviously doesn't work with something like 1:24.56, that's what I'm trying to fix. The time will be in one of these formats:</p>
  
  <pre><code>[seconds].[milliseconds]
  [minutes]:[seonds].[milliseconds]
  </code></pre>
  
  <p>Any ideas? I'm really new with Javascript so I'm not sure where to go with this.</p>
  
  <p>EDIT: The repo is <a href="https://github.com/Treedot/PolyTimer" rel="nofollow noreferrer">here</a>. All of the nonsense happens in the timer.js and main.js files.</p>