aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/formatter.js
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/common/formatter.js')
-rw-r--r--modern/src/common/formatter.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/modern/src/common/formatter.js b/modern/src/common/formatter.js
index 6968deb7..fed29a9d 100644
--- a/modern/src/common/formatter.js
+++ b/modern/src/common/formatter.js
@@ -43,6 +43,11 @@ export const formatPosition = (value, key, t) => {
}
};
+export const formatCourse = (value) => {
+ const courseValues = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'];
+ return courseValues[Math.floor(value / 45)];
+};
+
export const formatDistance = (value, unit, t) => {
switch (unit) {
case 'mi':