【发布时间】:2020-04-15 20:09:58
【问题描述】:
我想同时显示每小时英里数和每小时公里数。那可能吗?
我应该如何实现公里每小时计算并一起显示?
function getMiles (knots) {
var mph = (knots * 1.15078);
var speed = Math.round(mph);
if (speed < 50) {
return speed + console.log('mhp ');
}
if (speed > 50) {
return speed + console.log('mph , wind can be too strong today ');
};
}getMiles()
【问题讨论】:
标签: javascript jquery if-statement weather-api