diff options
author | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-02-06 17:35:34 +0530 |
---|---|---|
committer | Ashutosh Bishnoi <mail2bishnoi@gmail.com> | 2021-02-06 17:35:34 +0530 |
commit | 240518c0fc8b5237557affe8e28b9b94ef46a081 (patch) | |
tree | 76d4f970d796ec348934a071fb289721fdfa5859 /modern/src/common | |
parent | 4dbe654290c3d1f6051ea9650549f7c254d321b4 (diff) | |
download | trackermap-web-240518c0fc8b5237557affe8e28b9b94ef46a081.tar.gz trackermap-web-240518c0fc8b5237557affe8e28b9b94ef46a081.tar.bz2 trackermap-web-240518c0fc8b5237557affe8e28b9b94ef46a081.zip |
Maintenance screen working
Diffstat (limited to 'modern/src/common')
-rw-r--r-- | modern/src/common/converter.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modern/src/common/converter.js b/modern/src/common/converter.js index e48b0760..8193e77f 100644 --- a/modern/src/common/converter.js +++ b/modern/src/common/converter.js @@ -3,11 +3,29 @@ export const speedConverter = (value, unit) => { switch (unit) { case 'kmh': factor = 1.852; + break; case 'mph': factor = 1.15078; + break; case 'kn': default: factor = 1; } return (value * factor).toFixed(2); }; + +export const distanceConverter = (value, unit) => { + let factor; + switch (unit) { + case 'mi': + factor = 0.000621371; + break; + case 'nmi': + factor = 0.000539957; + break; + case 'km': + default: + factor = 0.001; + } + return (value * factor).toFixed(2); +}
\ No newline at end of file |