How to convert meters to miles

Mr.Happy picture Mr.Happy · Dec 19, 2013 · Viewed 25.4k times · Source

I want to convert meters to miles in JavaScript.

For example 12700 meters is 7.8867 miles.

What formula can I use to do the conversion?

Answer

Alan Bowen picture Alan Bowen · Dec 19, 2013
function getMiles(i) {
     return i*0.000621371192;
}
function getMeters(i) {
     return i*1609.344;
}