aboutsummaryrefslogtreecommitdiffstats
path: root/units.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-14 11:35:04 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-14 11:52:17 -0700
commit8c0d0de2e62356e1bbdad97843d185a37973c5c7 (patch)
tree0179eee9ba82a843f676551e61b9886930c9ceab /units.h
parente82f8ea565a68aa1fa980cb12c1f136b1d4a57f9 (diff)
downloadsubsurface-8c0d0de2e62356e1bbdad97843d185a37973c5c7.tar.gz
Location completer: give distance if known
If both the displayed dive and the dive site which is shown as a potential completion have a GPS fix, indicate the distance. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'units.h')
-rw-r--r--units.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/units.h b/units.h
index 0baf2ffa5..1273bd9bb 100644
--- a/units.h
+++ b/units.h
@@ -149,6 +149,11 @@ static inline double mm_to_feet(int mm)
return mm * 0.00328084;
}
+static inline double m_to_mile(int m)
+{
+ return m / 1609.344;
+}
+
static inline unsigned long feet_to_mm(double feet)
{
return rint(feet * 304.8);