

def decimal_2_degrees(decimal, latitude=True, add_direction=False):
    '\n    Converts a value in decimal degrees into a string with the format:\n    DD:MM.SS (degrees:minutes.seconds).\n    :param decimal: Decimal value to be converted.\n    :param latitude: Determines whether the decimal degrees are for the\n    latitude or for the longitude. This parameter is only necessary when it\n    is required to add the direction at the end of the string (N, S, W, E).\n    :param add_direction: If true, adds the direction for the DMS result.\n    :return: The degrees in DMS format (with optional direction).\n    '
    decimal = float(decimal)
    degrees = int(result)
    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

dataset/ETHPy150Open satnet-project/server/services/common/gis.py decimal_2_degrees/VarMisuse@31/241 `decimal`->`result`