convert the actual value to the type of the expected value for comparison