mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: return floating point from to_PSI() functions
Dive data are stored internally using integral types using appropriately fine units (mm, mbar, mkelvin, etc.). These are converted with functions defined in units.h for display (m, bar, C, etc.). Usually floating points are returned by these functions, to retain the necessary precision. There is one exception: the to_PSI() and mbar_to_PSI() functions. For consistency, make these functions likewise return floats. This will be needed for the rework of the profile-axes. The plan is to use the conversion functions to make the axes aware of the displayed values. This in turn will be necessary to place the ticks at sensible distances. However, the conversions need to be precise, which is not the case for the current to_PSI() functions. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
322e2baa8d
commit
0e9eee0a7f
6 changed files with 9 additions and 9 deletions
|
@ -16,7 +16,7 @@ int get_pressure_units(int mb, const char **units)
|
|||
unit = translate("gettextFromC", "bar");
|
||||
break;
|
||||
case PSI:
|
||||
pressure = mbar_to_PSI(mb);
|
||||
pressure = (int)lrint(mbar_to_PSI(mb));
|
||||
unit = translate("gettextFromC", "psi");
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue