fix(api): round estimated shopping price to integer minor units
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user