Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpavatte committed Jul 24, 2024
1 parent ffb9bf7 commit 0437881
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
14 changes: 9 additions & 5 deletions goldscrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@ <h1 style="color: gold;">Gold Scrap</h1>
<option value="10K">10K</option>
<option value="14K">14K</option>
<option value="18K">18K</option>
<option value="22K">22K</option>
</select>
</div>
<div>
<button id="calcPriceBtn" onclick="calcPrice()">Calculate</button>
</div>
<div>
<label for="tradeValue">Trade:</label>
<label for="scrapValue">Scrap:</label>
</div>
<div>
<input readonly id="tradeValue" />
<input readonly id="scrapValue" />
</div>
<div>
<label for="scrapValue">Scrap:</label>
<label for="tradeValue">Trade:</label>
</div>
<div>
<input readonly id="scrapValue" />
<input readonly id="tradeValue" />
</div>
<div>
<br>
Expand Down Expand Up @@ -113,11 +114,14 @@ <h1 style="color: gold;">Gold Scrap</h1>
karatFactor = 10.0 / 24.0;
}
else if (karatValue == "14K") {
karatFactor = 14.0 / 24.0;
karatFactor = .585;
}
else if (karatValue == "18K") {
karatFactor = 18.0 / 24.0;
}
else if (karatValue == "22K") {
karatFactor = 22.0 / 24.0;
}
let curSpt = await fetchBidPrice("gold");
let fullValueForTrade = gramNumber * (curSpt - fluctuatingPriceFactor) * troyOuncesToGramsFactor * karatFactor * refineryFeeAndDirtFactor;
let halfValueForScrap = fullValueForTrade / 2.0;
Expand Down
8 changes: 4 additions & 4 deletions silverscrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ <h1 style="color: silver;">Silver Scrap</h1>
<button id="calcPriceBtn" onclick="calcPrice()">Calculate</button>
</div>
<div>
<label for="tradeValue">Trade:</label>
<label for="scrapValue">Scrap:</label>
</div>
<div>
<input readonly id="tradeValue" />
<input readonly id="scrapValue" />
</div>
<div>
<label for="scrapValue">Scrap:</label>
<label for="tradeValue">Trade:</label>
</div>
<div>
<input readonly id="scrapValue" />
<input readonly id="tradeValue" />
</div>
<div>
<br>
Expand Down

0 comments on commit 0437881

Please sign in to comment.