Sfoglia il codice sorgente

buy: round materials to int

raylu 1 mese fa
parent
commit
47dc8e92c1
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      ts/buy.ts

+ 1 - 1
ts/buy.ts

@@ -141,7 +141,7 @@ async function calcForCX(username: string, apiKey: string, supplyForDays: number
 		if (buyAmount > 0) {
 			if (m.bids === 0)
 				tr.children[2].classList.add('red');
-			toBuy[m.ticker] = buyAmount;
+			toBuy[m.ticker] = Math.round(buyAmount);
 			const bid = prices.get(m.ticker)!.Bid!;
 			const epsilon = 10 ** (Math.floor(Math.log10(bid)) - 2);
 			const limit = bid + 2 * epsilon;