fix(api): round estimated shopping price to integer minor units

This commit is contained in:
Sven (AAMOS AI)
2026-08-16 22:49:09 +07:00
parent 8fe8900722
commit 9777c2ff1b
+1 -1
View File
@@ -387,7 +387,7 @@ async function generateItemsFromPlan(
const rounded = targetUnit === "COUNT" ? Math.ceil(qty) : Math.ceil(qty * 10) / 10;
const estimatedPrice =
info?.defaultPriceMinorPerKg != null
? Math.round((need.grams / 1000) * info.defaultPriceMinorPerKg * 10) / 10
? Math.round((need.grams / 1000) * info.defaultPriceMinorPerKg)
: null;
await app.db.insert(schema.shoppingListItems).values({