[PATCH] Use same weight in dive list and equipment list

Dirk Hohndel dirk at hohndel.org
Fri Oct 4 09:39:27 UTC 2013


On Fri, 2013-10-04 at 15:49 +0300, Benjamin wrote:
> Fix for issue 178 - lead weight shown differs
> Subsurface stores all weights in grams. When displaying lbs, the dive
> list was truncating the converted value at the decimal place, while
> the equipment list was rounding the value up. Both of them now round
> the value up to the nearest integer value when showing lbs.
> 
> 
> Would it be better to add another function to do this, or is it ok to
> have the same code twice? To put it differently,  are there any other
> places where this conversion might be needed? 
> 

Putting things like this in helper functions is always a good idea.

I took the patch as is - feel free to submit another one that adds
helper functions.

/D




More information about the subsurface mailing list