Cast string or number to boolean