import re


def get_float_from_string(s):
    """
    Clean up function for dirty data. Used for transceiver stats like
    current, voltage, etc.
    """
    ret = ''.join(re.findall(r"[-+]?\d*\.\d+|\d+", s))

    if len(ret) == 0:
        return 0

    return float(ret)