def METHOD_NAME(self, val, default=None):
    try:
        val = round(float(val), 6)
        if self._miot_property.is_integer:
            val = int(val)
    except (TypeError, ValueError):
        val = default
    return val