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 rounded = targetUnit === "COUNT" ? Math.ceil(qty) : Math.ceil(qty * 10) / 10;
|
||||||
const estimatedPrice =
|
const estimatedPrice =
|
||||||
info?.defaultPriceMinorPerKg != null
|
info?.defaultPriceMinorPerKg != null
|
||||||
? Math.round((need.grams / 1000) * info.defaultPriceMinorPerKg * 10) / 10
|
? Math.round((need.grams / 1000) * info.defaultPriceMinorPerKg)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
await app.db.insert(schema.shoppingListItems).values({
|
await app.db.insert(schema.shoppingListItems).values({
|
||||||
|
|||||||
Reference in New Issue
Block a user