title: Object has no method 'indexOf'
body: <p>I have the following function (taken from <a href="https://developers.google.com/maps/documentation/javascript/elevation" rel="nofollow">Elevation Service @ Google Maps API</a>)  which output for example <code>63.00425720214844</code> when I click somewhere on the map I have created with <a href="https://developers.google.com/maps/documentation/javascript/tutorial" rel="nofollow">Google Maps JavaScript API v3</a>:</p>
  
  <pre><code>function getElevation(event) {
      var locations = [];
      var clickedLocation = event.latLng;
      locations.push(clickedLocation);
  
      var positionalRequest = {
          'locations': locations
      }
  
      elevator.getElevationForLocations(positionalRequest, function(results, status) {
          if(status == google.maps.ElevationStatus.OK) {
              var s = results[0].elevation
              if(results[0]) {
                  alert(s.substring(0, s.indexOf('.') - 1));
              } else {
                  alert('Inget resultat hittades');
              }
          } else {
              alert('Det gick inte att hitta höjdskillnaden på grund av följande: ' + status);
          }
      });
  }
  </code></pre>
  
  <p>I want to remove everything after the dot including the dot, for example remove <code>.00425720214844</code> from <code>63.00425720214844</code> but when I click somewhere on the map, I'm getting this error message in the console: <code>Uncaught TypeError: Object 63.00425720214844 has no method 'indexOf'</code>.</p>
  
  <p>What have I done wrong?</p>
  
  <p>Thanks in advance.</p>