Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Convert an angle into a customizable degreeminutesecond string
ResourceFunction["GeneralizedDMSString"][θ] converts the angle θ in decimal degrees to a DMS string. 

ResourceFunction["GeneralizedDMSString"][θ,form] converts the angle θ in decimal degrees to a form string. 

ResourceFunction["GeneralizedDMSString"][{lat,lon}] converts latitude lat and longitude lon in decimal degrees to a DMS latitudelongitude string. 

ResourceFunction["GeneralizedDMSString"][{lat,lon},form] converts latitude lat and longitude lon in decimal degrees to a form latitudelongitude string. 

ResourceFunction["GeneralizedDMSString"][GeoPosition[{lat,lon}],form] converts a GeoPosition to a form latitudelongitude string. 
Convert an angle in a DMS string:
In[1]:= 

Out[1]= 

Convert a latitudelongitude pair:
In[2]:= 

Out[2]= 

Convert to a string with degrees and minutes:
In[3]:= 

Out[3]= 

Convert to a string with only degrees:
In[4]:= 

Out[4]= 

Use a GeoPosition instead:
In[5]:= 

Out[5]= 

Convert only a latitude in to a DMS string:
In[6]:= 

Out[6]= 

Convert only a longitude in to a DMS string:
In[7]:= 

Out[7]= 

Use different symbols for degrees, minutes, and seconds:
In[8]:= 

Out[8]= 

Use no symbols for degrees, minutes, and seconds:
In[9]:= 

Out[9]= 

Use the default symbols for degrees, minutes, and seconds:
In[10]:= 

Out[10]= 

Use no cardinal indicators:
In[11]:= 

Out[11]= 

Use N for the latitude and E for the longitude, signs indicates the hemisphere:
In[12]:= 

Out[12]= 

Signs are removed and replaced by the proper cardinal direction:
In[13]:= 

Out[13]= 

Use the standard 4 cardinal directions written fully out:
In[14]:= 

Out[14]= 

Use custom cardinal directions:
In[15]:= 

Out[15]= 

Use a custom specification where the sign is retained:
In[16]:= 

Out[16]= 

Place the cardinal symbols before the degrees, minutes, and seconds:
In[17]:= 

Out[17]= 

Place the cardinal symbols after the degrees, minutes, and seconds:
In[18]:= 

Out[18]= 

Use 3 digits for degrees:
In[19]:= 

Out[19]= 

Use 3 digits for degrees, and 2 for minutes:
In[20]:= 

Out[20]= 

Use 3 digits for degrees, 2 for minutes, and 2 for seconds:
In[21]:= 

Out[21]= 

Use different specifications for the latitude and longitude:
In[22]:= 

Out[22]= 

Use 5 digits for the last number (in this case the seconds):
In[23]:= 

Out[23]= 

Use 3 digits for the last number (in this case the minutes):
In[24]:= 

Out[24]= 

Use underscores between degrees, minutes, and seconds, and between the latitude and longitude:
In[25]:= 

Out[25]= 

Use underscores between degrees, minutes, and seconds, and a comma between the latitude and longitude:
In[26]:= 

Out[26]= 

Use no separators:
In[27]:= 

Out[27]= 

Make a function that produces a string generally used in geocaching:
In[28]:= 

Apply this function to a location:
In[29]:= 

Out[29]= 

For a latitudelongitude pair, and without any options GeneralizedDMSString gives the same output as DMSString:
In[30]:= 

Out[31]= 

In[32]:= 

Out[32]= 

GeneralizedDMSString keeps the sign as opposed to DMSString:
In[33]:= 

Out[33]= 

In[34]:= 

Out[34]= 

Exact values are approximated using N:
In[35]:= 

Out[35]= 

Don’t show the zeroes behind the period:
In[36]:= 

Out[36]= 

This work is licensed under a Creative Commons Attribution 4.0 International License