summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index c03d124a4..a98b10412 100644
--- a/dive.c
+++ b/dive.c
@@ -101,6 +101,13 @@ double get_volume_units(unsigned int ml, int *frac, const char **units)
return vol;
}
+unsigned int units_to_depth(double depth)
+{
+ if (get_units()->length == METERS)
+ return rint(depth * 1000);
+ return feet_to_mm(depth);
+}
+
double get_depth_units(unsigned int mm, int *frac, const char **units)
{
int decimals;