A necklace containing beads and gold was brought to the Messenger of Allah ﷺ while he was at Khaybar. It was part of the spoils being sold. The Messenger of Allah ﷺ ordered that the gold in the necklace be separated out on its own, then he said to them, "Gold for gold, weight for weight."
أتي رسول الله ﷺ- وهو بخيبر- بقلادة فيها خرز وذهب، وهي من المغانم تباع، فأمر رسول الله ﷺ بالذهب الذي في القلادة، فنزع وحده، ثم قال لهم رسول الله ﷺ: الذهب بالذهب وزنا بوزن.
Muslim narrated it in the Book of Musaqah (1591) from Abu Tahir Ahmad bin Amr bin Sarh, from Ibn Wahb, from Abu Hani Khawlani, who heard Ali bin Rabah Lakhmi say, I heard Fadala bin Ubayd Ansari, and he mentioned it.He also narrated it through another route from Fadala bin Ubayd, who said, "On the day of Khaybar I bought a necklace for twelve dinars, containing gold and beads. I took it apart and found in it more than twelve dinars' worth of gold. I mentioned this to the Prophet ﷺ, and he said, 'It is not to be sold until it is taken apart.'"