gold-melt-value
Compute precious-metal melt value from karat (purity), weight, and a live spot price. Pure, dependency-free Rust math — the same engine behind the GoldGramPrice live gold calculator, which shows the price of gold per gram by karat.
Why
Gold is quoted per troy ounce, but most people hold it in grams and in mixed
karats, so the headline spot price is rarely what a given piece is worth. Melt
value = grams × (karat/24) × (spot ÷ 31.1034768). This crate does that math (and
pennyweight / troy-ounce variants) with no dependencies.
Usage
use ;
let spot_per_oz = 3983.30; // USD per troy ounce
let grams = 10.0; // a 10 g chain
let karat = 14;
let usd = melt_value_grams;
assert!;
assert_eq!;
Live calculator
For an interactive, always-fresh version with today's spot price built in, see the free gold melt-value calculator and the 14k gold price per gram page.
License: MIT