Add helper function for doing depth unit calculations

.. and use it for printing too.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2011-09-21 12:12:54 -07:00
parent 184eecf7c0
commit 515a917152
4 changed files with 37 additions and 17 deletions

2
dive.h
View file

@ -86,6 +86,8 @@ typedef struct {
pressure_t start, end;
} cylinder_t;
extern double get_depth_units(unsigned int mm, int *frac, const char **units);
static inline double mm_to_feet(int mm)
{
return mm * 0.00328084;