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.
This commit is contained in:
@@ -3738,7 +3738,8 @@ class FalukantService extends BaseService {
|
|||||||
const priceInCity = min + (max - min) * (knowledgeFactor / 100);
|
const priceInCity = min + (max - min) * (knowledgeFactor / 100);
|
||||||
|
|
||||||
// Nur Städte zurückgeben, wo der Preis höher ist
|
// 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
|
// Branch-Typ bestimmen
|
||||||
let branchType = null; // null = kein Branch
|
let branchType = null; // null = kein Branch
|
||||||
if (city.branches && city.branches.length > 0) {
|
if (city.branches && city.branches.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user