From 240518c0fc8b5237557affe8e28b9b94ef46a081 Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Sat, 6 Feb 2021 17:35:34 +0530 Subject: Maintenance screen working --- modern/src/common/converter.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'modern/src/common') 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 -- cgit v1.2.3