def METHOD_NAME(self, val):
    try:
        if isinstance(val, str):
            val = val.strip()
            if self.format == DECODE_FORMAT.THOUSANDTH:
                return float("%.1f" % (float(val) / 1000))
            elif self.format == DECODE_FORMAT.HUNDREDTH:
                return float("%.1f" % (float(val) / 100))
            elif self.format == DECODE_FORMAT.ONE_BIT_HEX:
                return (int(val, 16) & (1 << self.bit)) >> self.bit
            elif self.format == DECODE_FORMAT.DECIMAL:
                return int(val, 10)
            elif self.format == DECODE_FORMAT.MILLIONTH:
                return float("%.1f" % (float(val) / 1000 / 1000))
            elif self.format == DECODE_FORMAT.AND:
                return (int(val, 16)) & self.mask
        elif isinstance(val, list):
            if self.format == DECODE_FORMAT.JOIN:
                return self.sep.join(val)
    except Exception as e:
        raise e
    else:
        return val