[PATCH] Fix mean depth on info box

Miika Turkia miika.turkia at gmail.com
Thu Jan 1 04:27:57 PST 2015


The running depth must be divided by current time to get the average
depth.

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 profile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/profile.c b/profile.c
index efc6de4..5c06658 100644
--- a/profile.c
+++ b/profile.c
@@ -1200,8 +1200,8 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
 	if (entry->bearing)
 		put_format(b, translate("gettextFromC", "bearing: %d\n"), entry->bearing);
 	if (entry->running_sum) {
-		depthvalue = get_depth_units(entry->running_sum / 1000, NULL, &depth_unit);
-		put_format(b, translate("gettextFromC", "mean depth to here %.1f%s\n"), depthvalue, depth_unit);
+		depthvalue = get_depth_units(entry->running_sum, NULL, &depth_unit);
+		put_format(b, translate("gettextFromC", "mean depth to here %.1f%s\n"), depthvalue / entry->sec, depth_unit);
 	}
 
 	strip_mb(b);
-- 
1.9.1



More information about the subsurface mailing list