From 30afad54730dfdf2a363ded9d3824e9cbd15b4c8 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sun, 10 Mar 2024 09:01:14 +0100 Subject: [PATCH] Refactoring --- apps/api/src/app/portfolio/portfolio-calculator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/api/src/app/portfolio/portfolio-calculator.ts b/apps/api/src/app/portfolio/portfolio-calculator.ts index fe00e20db..faf954bbd 100644 --- a/apps/api/src/app/portfolio/portfolio-calculator.ts +++ b/apps/api/src/app/portfolio/portfolio-calculator.ts @@ -1315,9 +1315,9 @@ export class PortfolioCalculator { previousOrderDate ); if (daysSinceLastOrder <= 0) { - // The time between two transactions on the same day is unknown - // -> Set it to an arbitrary value of 0.25 (= 6 hours) - daysSinceLastOrder = 0.25; + // The time between two activities on the same day is unknown + // -> Set it to the smallest floating point number greater than 0 + daysSinceLastOrder = Number.EPSILON; } // Sum up the total investment days since the start date to calculate