Can you put this logic into a separate function? Something along the lines of `double parse_with_suffix (char const *str)`.