Converting Tanksize

3rd party extensions (phpDivingLog, dive computer downloader,...)
Post Reply
FlyinV
Posts: 6
Joined: Wed Oct 31, 2012 16:28

Converting Tanksize

Post by FlyinV » Fri Jul 19, 2013 14:33

Hello,
I am an American so I have the display in dive log 5 set for Tanks Size in Cubic Feet.
I export out my dive log to mySQL so the tanksize is stored in liters.
(I wish the USA would have converted to Metric system back in the 70's but that's another topic)

I have built myself a little Android App that connects to mySQL so I can view my dive log on my device.

I got all the temperatures, weights and other things converted from Metric to Imperial but I can't yet work out how to get the Tanksize to convert to Cubic Feet for display purposes.

If anyone has the formula please let me know :)

I will dig thru the phpDiveLog scrips and see if I can see how they did it.

If anyone is interested in an Android App to connect to their dive log stored on their mySQL server -- Send me a message and I will gladly give you the app when its all done.

divinglog
Site Admin
Posts: 4698
Joined: Sat Feb 08, 2003 21:02
Location: Coburg
Contact:

Re: Converting Tanksize

Post by divinglog » Fri Jul 19, 2013 15:09

Hi

This is the formula I'm using in Diving Log. It depends on whether the working pressure field has a value or not:

Code: Select all

        Public Shared Function ToCuFt(ByVal Liter As Single, ByVal PresW As Single) As Single
            If PresW <= 0 Then
                Return Liter * 7
            Else
                Return Liter * 0.035335689046 * PresW
            End If
        End Function
If you want I can add your app to the Android page when it's ready.

Sven

FlyinV
Posts: 6
Joined: Wed Oct 31, 2012 16:28

Re: Converting Tanksize

Post by FlyinV » Fri Jul 19, 2013 15:28

Thanks Sven!
That is exactly what I needed to know.

Post Reply