def decimal_2_degrees(decimal, latitude=True, add_direction=False):
    decimal = float(decimal)
    degrees = int(decimal)
    submin = abs((decimal - degrees) * 60)
    minutes = int(submin)
    subseconds = abs((submin - minutes) * 60)

    result = str(degrees) + ":" + str(minutes) + ":" +\
        "{0:.2f}".format(subseconds)

    if add_direction:
        if latitude:
            return result + "" + get_latitude_direction(degrees)
        else:
            return result + "" + get_longitude_direction(degrees)

    return result
Converts a value in decimal degrees into a string with the format:
dataset/ETHPy150Open satnet-project/server/services/common/gis.py/decimal_2_degrees