From 3d6fdc65d2af3af720b26c0764e70e181e1fd61b Mon Sep 17 00:00:00 2001 From: "Torsten Schulz (local)" Date: Tue, 2 Dec 2025 15:57:29 +0100 Subject: [PATCH] Refine price comparison logic in FalukantService to include a tolerance for rounding errors - Updated the price comparison condition to account for a small tolerance (0.001) when determining if the calculated price in a city exceeds the current price, improving accuracy in pricing evaluations. --- backend/services/falukantService.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/services/falukantService.js b/backend/services/falukantService.js index cc1dccd..67cb403 100644 --- a/backend/services/falukantService.js +++ b/backend/services/falukantService.js @@ -3738,7 +3738,8 @@ class FalukantService extends BaseService { const priceInCity = min + (max - min) * (knowledgeFactor / 100); // Nur Städte zurückgeben, wo der Preis höher ist - if (priceInCity > currentPrice) { + // Verwende eine kleine Toleranz (0.001) um Rundungsfehler zu vermeiden + if (priceInCity > currentPrice + 0.001) { // Branch-Typ bestimmen let branchType = null; // null = kein Branch if (city.branches && city.branches.length > 0) {