Converts value to numeric in a more careful way.