Inventory item values question

Inventory item values question

What happens if we buy an inventory item for a certain price; eg £10,  then later on the cost price goes up and we buy another one for say £12. The quantity will say 2, but what will be the value of the 2 items?

When we do year end stock checking, I'm guessing it will say 2@ £12 = £24, but we will only have paid £22.
Thanks