diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index 6a5aed6..c4ac809 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -3750,8 +3750,9 @@ class FalukantService extends BaseService { console.log(`[getProductPricesInCities] City: ${city.name} (${city.id}), worthPercent=${worthPercent}, basePrice=${basePrice}, priceInCity=${priceInCity}, currentPrice=${currentPrice}, isBetter=${priceInCity > currentPrice}`); // Nur Städte zurückgeben, wo der Preis höher ist - // Keine Toleranz, da wir die aktuelle Stadt bereits ausschließen - if (priceInCity > currentPrice) { + // Kleine Toleranz (0.01) für Rundungsfehler bei Gleitkommaberechnungen + const PRICE_TOLERANCE = 0.01; + if (priceInCity > currentPrice - PRICE_TOLERANCE) { // Branch-Typ bestimmen let branchType = null; // null = kein Branch if (city.branches && city.branches.length > 0) {