Browse Source

Small fix

pull/701/head
Reto Kaul 3 years ago
parent
commit
87112b4b78
  1. 9
      apps/api/src/app/portfolio/portfolio-calculator-new.ts

9
apps/api/src/app/portfolio/portfolio-calculator-new.ts

@ -451,8 +451,13 @@ export class PortfolioCalculatorNew {
}
}
grossPerformancePercentage = grossPerformancePercentage.div(sumOfWeights);
netPerformancePercentage = netPerformancePercentage.div(sumOfWeights);
if (sumOfWeights.gt(0)) {
grossPerformancePercentage = grossPerformancePercentage.div(sumOfWeights);
netPerformancePercentage = netPerformancePercentage.div(sumOfWeights);
} else {
grossPerformancePercentage = new Big(0);
netPerformancePercentage = new Big(0);
}
return {
currentValue,

Loading…
Cancel
Save