def line_edit_val(le_wg, default_val):
    """Get QLineEdit field value.

    Parameters
    ----------
    le_wg : QtGui.QLineEdit
        QtGui.QLineEdit widget
    default_val : float
        Default value of the widget

    Returns
    -------
    le_val : float
        the value in the widget
    """
    le_val = le_wg.text()

    try:
        return float(le_val)
    except ValueError:
        return default_val