Skip to content

Commit 6e81f56

Browse files
authored
fix: If there is in the data a epsilon issue, we just remove it at latest point to ensure the export and rendering looks good (#622)
1 parent 21f881d commit 6e81f56

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/app/services/analytics/origin-destination/components/origin-destination.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
computeShortestPaths,
1010
topoSort,
1111
} from "src/app/view/util/origin-destination-graph";
12+
import {MathUtils} from "../../../../utils/math";
1213

1314
// Computed values for an origin/destination pair.
1415
export type OriginDestination = {
@@ -115,9 +116,9 @@ export class OriginDestinationService {
115116
destination: destination.getBetriebspunktName(),
116117
originId: origin.getId(),
117118
destinationId: destination.getId(),
118-
travelTime: totalCost - connections * connectionPenalty,
119-
transfers: connections,
120-
totalCost: totalCost,
119+
travelTime: MathUtils.round(totalCost - connections * connectionPenalty, 10),
120+
transfers: MathUtils.round(connections, 10),
121+
totalCost: MathUtils.round(totalCost, 10),
121122
found: true,
122123
};
123124
rows.push(row);

0 commit comments

Comments
 (0)