def mm_to_in(val):
    """
    Converts millimeters to inches; accepts numeric or string
    """
    try:
        return float(val) * 0.0393701
    except (TypeError, ValueError):
        return val * 0.0393701