Converts a hexadecimal string to a decimal number.