How do you determine the value of a commodity?

Simple formula to determine the value of a commodity:
Weight of commodity (X) Purity Percentage (X) Buying rate = Value (-) service charges = Payout Value