tempAry.sort(function (a, b) { return b.longitude - a.longitude })
tempAry.splice(0, 2);
tempAry.splice(tempAry.length - 2, 2);
var sumlong = 0;
var sumlat = 0;
for(var i = 0; i < tempAry.length; i++) {
sumlong += tempAry[i].longitude;
sumlat += tempAry[i].latitude;
}
that.setData({
longitudeing: (sumlong/tempAry.length).toFixed(6),
latitudeing: (sumlat/tempAry.length).toFixed(6),
});
只能输入小数点
oninput="value=value.replace(/[^\d.]/g,'')"
只能输入整数
oninput="value=value.replace(/[^\d]/g,'')"