We have that he bought 2 units and 3/8 of a unit of ham, we determine its cost as follows:
*We find the simple fraction that represents what he bought:

Now, we determine it's cost:

These values are the cost of one unit times the quantity we want to know the cost of, divided by the unit.
From this, we have that the cost of the ham Juan bought he had to pay approximately $14.23.