Dirk,

stumbled across this report:
https://github.com/Subsurface-divelog/subsurface/issues/412

the UI seems to round values larger than 40lbs up to the next integer
value - e.g. 41lbs -> 42lbs.

https://github.com/Subsurface-divelog/subsurface/blob/master/core/qthelper.cpp#L54

my understanding is that we want to show a fractional part if a value
is under 40lbs, but not if over it?

perhaps both the lrint() calls should be removed and let QString()
with 'f' (0/1) handle that?

demo patch attached.

lubomir
--
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 811f653..2a897e8 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -51,10 +51,6 @@ QString weight_string(int weight_in_grams)
 			str = QString("%1.%2").arg(kg).arg((unsigned)(gr + 50) / 100);
 	} else {
 		double lbs = grams_to_lbs(weight_in_grams);
-		if (lbs >= 40.0)
-			lbs = lrint(lbs + 0.5);
-		else
-			lbs = lrint(lbs + 0.05);
 		str = QString("%1").arg(lbs, 0, 'f', lbs >= 40.0 ? 0 : 1);
 	}
 	return (str);
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to