aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/converter.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-12-13 10:13:57 -0800
committerGitHub <noreply@github.com>2020-12-13 10:13:57 -0800
commitfca5aa3cdb5d335dca14115722cacae1b724fe4f (patch)
tree542416ca2e13ff811b818d2343e2b487fda97b86 /modern/src/common/converter.js
parenta4c2f0477dcda2662a3fd268f77a7549dead6e67 (diff)
parentf8bb2fb5dfd801b7c49a3a3b66042e94dc7640dc (diff)
downloadtrackermap-web-fca5aa3cdb5d335dca14115722cacae1b724fe4f.tar.gz
trackermap-web-fca5aa3cdb5d335dca14115722cacae1b724fe4f.tar.bz2
trackermap-web-fca5aa3cdb5d335dca14115722cacae1b724fe4f.zip
Merge pull request #797 from mail2bishnoi/chart-report
Implementing chart report initial structure
Diffstat (limited to 'modern/src/common/converter.js')
-rw-r--r--modern/src/common/converter.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/modern/src/common/converter.js b/modern/src/common/converter.js
new file mode 100644
index 00000000..e48b0760
--- /dev/null
+++ b/modern/src/common/converter.js
@@ -0,0 +1,13 @@
+export const speedConverter = (value, unit) => {
+ let factor;
+ switch (unit) {
+ case 'kmh':
+ factor = 1.852;
+ case 'mph':
+ factor = 1.15078;
+ case 'kn':
+ default:
+ factor = 1;
+ }
+ return (value * factor).toFixed(2);
+};