convertStr2Float(string)

Convert string to float. If failed, return the string itself.

Source code in dmff/utils.py
48
49
50
51
52
53
54
55
def convertStr2Float(string: str):
    """
    Convert string to float. If failed, return the string itself.
    """
    try:
        return float(string)
    except ValueError as e:
        return string