fixed temporary evaluation of MAX and PROD

This commit is contained in:
Luca Montagna
2022-01-22 13:32:35 +01:00
parent 07fe3c1906
commit bfa271881b
3 changed files with 10 additions and 7 deletions
+2 -2
View File
@@ -109,8 +109,8 @@ export function SellMaterial(mat: Material, amt: string, price: string): void {
if (amt.includes("MAX") || amt.includes("PROD")) {
let q = amt.replace(/\s+/g, "");
q = q.replace(/[^-()\d/*+.MAXPROD]/g, "");
let tempQty = q.replace(/MAX/g, "1");
tempQty = tempQty.replace(/PROD/g, "1");
let tempQty = q.replace(/MAX/g, mat.maxsll.toString());
tempQty = tempQty.replace(/PROD/g, mat.prd.toString());
try {
tempQty = eval(tempQty);
} catch (e) {