How to convert coordinates from degrees, minutes, seconds to decimal format

How to DD.DDDDDD  to  DD°MM’SS.SSS”

Here’s how to do it alone.
Conversion from degrees, minutes, seconds to decimal format:
Conversion is by adding degrees minutes divided by 60, plus seconds divided to 3600.

Example:
If we have  42° 41′ 48.6528″ 23° 19′ 14.9298″
=>
42+(41/60)+(48.6528/3600) => 42.696848
23+(19/60)+(14.9298/3600) => 23.320813

 

Conversion from decimal format to degrees, minutes, seconds:

The number before the decimal point are degrees. Take only the decimal part and multiply by 60. The resulting number to the decimal point are minute. Again taking only the decimal part and multiply by 60. Receiving seconds.

Example:
42.696848 =>
42 degrees
0.696848 * 60 = 41.81088 => 41 minutes
0.81088 * 60 = 48.6528 => 48.6528 seconds
This equal to 42° 41′ 48.6528″