Possible Duplicate:
How do you round to 1 decimal place in Javascript?
The following code, displays the total distance covered, on a particular route, displayed on google maps. I managed to convert the number from kilometers to miles. Here is the code for the function:
function computeTotalDistance(result) {
        var total = 0;
        var myroute = result.routes[0];
        for (i = 0; i < myroute.legs.length; i++) {
          total += myroute.legs[i].distance.value;
        }
        total = total *0.621371/ 1000.
        document.getElementById('total').innerHTML = total + ' mi';
The total is displayed as 41.76483039399999 mi. How would round off the total to one decimal place?
 
     
     
     
     
    