GoldKaratValue 0.1.0
dotnet add package GoldKaratValue --version 0.1.0
NuGet\Install-Package GoldKaratValue -Version 0.1.0
<PackageReference Include="GoldKaratValue" Version="0.1.0" />
<PackageVersion Include="GoldKaratValue" Version="0.1.0" />
<PackageReference Include="GoldKaratValue" />
paket add GoldKaratValue --version 0.1.0
#r "nuget: GoldKaratValue, 0.1.0"
#:package GoldKaratValue@0.1.0
#addin nuget:?package=GoldKaratValue&version=0.1.0
#tool nuget:?package=GoldKaratValue&version=0.1.0
GoldKaratValue
Estimate gold melt value from karat, weight, and a 24K price per gram.
Jewelry and scrap workflows usually start from the same three inputs: how heavy the piece is, what karat stamp it carries, and what fine gold is trading at today. This library keeps that math in one place so a .NET app or script can reuse the same rounding rules.
It does not call a price API. You pass in the 24K price you already have (spot feed, cached quote, or a number typed by the user).
Install
dotnet add package GoldKaratValue
Usage
using GoldKaratValue;
var melt = Calculator.MeltValue(10, WeightUnit.Gram, 14, 65);
Console.WriteLine($"14K melt: ${melt.Total:0.00} (${melt.PerGram:0.00}/g)");
var scrap = Calculator.ScrapValue(10, WeightUnit.Gram, 14, 65, 0.85);
Console.WriteLine($"85% scrap offer: ${scrap.Scrap:0.00}");
WeightUnit covers grams, pennyweight, troy ounces, troy pounds, and kilograms. Karat must be between 0 and 24 (including fractional stamps such as 21.6).
Formula
- Convert the entered weight to grams.
- Purity ratio = karat ÷ 24 (14K ≈ 0.5833).
- Price per gram at that karat = 24K price per gram × ratio, rounded to cents.
- Melt value = grams × that per-gram price, rounded to cents.
- Scrap estimate = melt value × a payout ratio between 0 and 1 (for example 0.50 at a pawn shop, 0.85 for some online buyers).
The same cent-rounding is applied to per-gram, per-troy-ounce, and per-troy-pound quotes so table output stays consistent with a UI.
When you need live prices
This library stops at the arithmetic. If you want the same karat and unit conversion with a regularly updated spot price in the browser, there is a scrap gold calculator that applies these ratios without an account.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 111 | 8/30/2026 |