title: getting number only from 10.0 or 2
body: <p>I am trying to figure out how to go about detecting what browser is being used. Some report the version as being 10.0, 10, 4.6 or 5. How can i just get the whole number without any .x at the end (if it has one to begin with)?</p>
  
  <p>I currently use this:</p>
  
  <pre><code>version = version.substring(0,3);
  </code></pre>
  
  <p>Which works if its a whole number but not if it has a period in them.</p>
  
  <p>David</p>