parse value to integer/boolean