Converts a hexadecimal number to decimal