balsimpson
9/25/2017 - 7:40 AM

getDistance

convert meters into kms and mtr according to value

function getDistance(distance) {
	var distance = distance;
	var dist = '';
	if (distance > 1000) {
		dist = (distance / 1000).toFixed(1) + ' km';
	} else {
		dist = distance + ' mtr';
	}
	return dist;
}