I am sorry - you are right and I am wrong. Multiplying the decimal part by 3600 and rounding it will give you the number of seconds. Dividing that by 60 will give you the whole minutes and the remainder will be the seconds value. I cannot show you the code for this right now.
Try this code. It gives the right values for degrees, minutes and seconds but does not format the answer (that is, it does not add leading zeroes).
B4X:
Dim degrees As Double = 55.801509857177734
Dim seconds As Int = (degrees - Floor(degrees)) * 3600
degrees = Floor(degrees)
Dim minutes As Int = seconds / 60
seconds = seconds Mod 60
Log("Angle = " & degrees & ":" & minutes & ":" & seconds)
Dim lat As Double = 55.801509857177734
Dim Grados As Int = Floor(lat)
Dim Minutos As Int = Floor((lat - Grados) * 60)
Dim Segundos As Int = Round((((lat - Grados) * 60) - Minutos) * 60)
Log($"${Grados}:${Minutos}:${Segundos}"$)
Dim latitud_decimal As Double = Grados + Minutos / 60 + Segundos / 3600
Log(latitud_decimal)
Brian Dean, TILogistic thanks for your input!
I guess I didn't formulate my problem well.
The coordinate can be entered in either decimal or degrees, minutes and seconds format. The coordinate value is stored in the database in decimal format.
It looks like I have the wrong conversion from one format to another that takes into account the decimal part of the seconds.