Explicitly convert m/s wind to mph in imperial units

This commit is contained in:
Joshua Taillon 2022-11-07 15:18:19 -07:00
parent 7e9a993d7e
commit 842ba72819
4 changed files with 13 additions and 14 deletions

View File

@ -1,13 +1,8 @@
<template> <template>
<div class="wind"> <div class="wind">
<Distance {{ useImperialUnits ?
:distance="weather.wind" convert_mps_to_mph(Number(weather.wind)).toFixed(1) + ' mph' :
unitFrom="m" Number(weather.wind).toFixed(1) + " m/s" }}
:digits="1"
:displayUnit="false"
:useImperialUnits="useImperialUnits"
/>
{{ useImperialUnits ? 'ft' : 'm' }}/s
<div class="wind-bearing"> <div class="wind-bearing">
<i <i
v-if="weather.windBearing" v-if="weather.windBearing"
@ -45,6 +40,10 @@
)}` )}`
) )
} }
function convert_mps_to_mph(windSpeed: number): number {
return windSpeed * 2.2369363
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -94,8 +94,8 @@
"SUCCESSFUL_UPDATE": "Dein Konto wurde erfolgreich aktualisiert.", "SUCCESSFUL_UPDATE": "Dein Konto wurde erfolgreich aktualisiert.",
"UNITS": { "UNITS": {
"LABEL": "Einheiten für die Distanz", "LABEL": "Einheiten für die Distanz",
"IMPERIAL": "Imperiales System (ft, mi, °F)", "IMPERIAL": "Imperiales System (ft, mi, mph, °F)",
"METRIC": "Metrisches System (m, km, °C)" "METRIC": "Metrisches System (m, km, m/s, °C)"
}, },
"TIMEZONE": "Zeitzone" "TIMEZONE": "Zeitzone"
}, },

View File

@ -94,8 +94,8 @@
"SUCCESSFUL_UPDATE": "Your account has been updated successfully.", "SUCCESSFUL_UPDATE": "Your account has been updated successfully.",
"UNITS": { "UNITS": {
"LABEL": "Units for distance", "LABEL": "Units for distance",
"IMPERIAL": "Imperial system (ft, mi, °F)", "IMPERIAL": "Imperial system (ft, mi, mph, °F)",
"METRIC": "Metric system (m, km, °C)" "METRIC": "Metric system (m, km, m/s, °C)"
}, },
"TIMEZONE": "Timezone" "TIMEZONE": "Timezone"
}, },

View File

@ -82,8 +82,8 @@
}, },
"UNITS": { "UNITS": {
"LABEL": "Unités pour les distances", "LABEL": "Unités pour les distances",
"IMPERIAL": "Système impérial (ft, mi, °F)", "IMPERIAL": "Système impérial (ft, mi, mph, °F)",
"METRIC": "Système métrique (m, km, °C)" "METRIC": "Système métrique (m, km, m/s, °C)"
}, },
"SPORT": { "SPORT": {
"ACTION": "action", "ACTION": "action",