Browse Source

show volume

raylu 1 month ago
parent
commit
6ea15d73ab
4 changed files with 17 additions and 3 deletions
  1. 8 2
      dist/main.js
  2. 0 0
      dist/main.js.map
  3. 1 0
      index.html
  4. 8 1
      src/main.ts

+ 8 - 2
dist/main.js

@@ -34,7 +34,12 @@ function render({ recipes, prices }) {
       return sum + price.PriceAverage * input.Amount;
     }, 0);
     const dailyProfit = (revenuePerRun - costPerRun) * runsPerDay;
-    profits.push({ recipeName: recipe.RecipeName, dailyProfit, traded: outputPrice.Traded });
+    profits.push({
+      recipeName: recipe.RecipeName,
+      dailyProfit,
+      traded: outputPrice.Traded,
+      priceAverage: outputPrice.PriceAverage
+    });
   }
   profits.sort((a, b) => b.dailyProfit - a.dailyProfit);
   const fmt = new Intl.NumberFormat(undefined, { maximumFractionDigits: 2 });
@@ -45,6 +50,7 @@ function render({ recipes, prices }) {
     row.innerHTML = `
 			<td>${profit.recipeName}</td>
 			<td>${fmt.format(profit.dailyProfit)}</td>
+			<td>${fmt.format(profit.traded * profit.priceAverage)}</td>
 			<td>${fmt.format(profit.traded)}</td>
 		`;
     tbody.appendChild(row);
@@ -52,4 +58,4 @@ function render({ recipes, prices }) {
 }
 fetchData().then(render);
 
-//# debugId=70C1D9063E5E875D64756E2164756E21
+//# debugId=2EBCAC0FA236EC3864756E2164756E21

File diff suppressed because it is too large
+ 0 - 0
dist/main.js.map


+ 1 - 0
index.html

@@ -13,6 +13,7 @@
 				<tr>
 					<th>recipe</th>
 					<th>daily profit</th>
+					<th>volume</th>
 					<th>traded</th>
 				</tr>
 			</thead>

+ 8 - 1
src/main.ts

@@ -18,6 +18,7 @@ interface RecipeProfit {
 	recipeName: string;
 	dailyProfit: number;
 	traded: number;
+	priceAverage: number;
 }
 
 async function fetchData(): Promise<{recipes: Recipe[]; prices: Price[]}> {
@@ -57,7 +58,12 @@ function render({recipes, prices}: {recipes: Recipe[], prices: Price[]}) {
 			return sum + price.PriceAverage * input.Amount;
 		}, 0);
 		const dailyProfit = (revenuePerRun - costPerRun) * runsPerDay;
-		profits.push({ recipeName: recipe.RecipeName, dailyProfit, traded: outputPrice.Traded });
+		profits.push({
+			recipeName: recipe.RecipeName,
+			dailyProfit,
+			traded: outputPrice.Traded,
+			priceAverage: outputPrice.PriceAverage
+		});
 	}
 	profits.sort((a, b) => b.dailyProfit - a.dailyProfit);
 
@@ -69,6 +75,7 @@ function render({recipes, prices}: {recipes: Recipe[], prices: Price[]}) {
 		row.innerHTML = `
 			<td>${profit.recipeName}</td>
 			<td>${fmt.format(profit.dailyProfit)}</td>
+			<td>${fmt.format(profit.traded * profit.priceAverage)}</td>
 			<td>${fmt.format(profit.traded)}</td>
 		`;
 		tbody.appendChild(row);

Some files were not shown because too many files changed in this diff