From cad15f7c2a49f4c6e7d3308079bad003f5d9fd62 Mon Sep 17 00:00:00 2001 From: JoryHogeveen Date: Fri, 15 Nov 2024 00:50:34 +0100 Subject: [PATCH] Add parent value and fix percentage calculation --- .../allocations/allocations-page.component.ts | 5 ++--- .../lib/top-holdings/top-holdings.component.html | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts index d489e38eb..fa7db8f00 100644 --- a/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts +++ b/apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts @@ -498,10 +498,9 @@ export class AllocationsPageComponent implements OnDestroy, OnInit { for (const index in parentHoldings) { if (name === parentHoldings[index].name) { return { - name: symbol, + name: holding.name ?? symbol, allocationInPercentage: - (parentHoldings[index].valueInBaseCurrency / value) * - 100, + parentHoldings[index].valueInBaseCurrency / value, valueInBaseCurrency: parentHoldings[index].valueInBaseCurrency }; diff --git a/libs/ui/src/lib/top-holdings/top-holdings.component.html b/libs/ui/src/lib/top-holdings/top-holdings.component.html index 889c83889..da0784bd5 100644 --- a/libs/ui/src/lib/top-holdings/top-holdings.component.html +++ b/libs/ui/src/lib/top-holdings/top-holdings.component.html @@ -76,9 +76,18 @@ >{{ parentHolding.name }}: - {{ - parentHolding.allocationInPercentage | number: '1.0-2' - }}% + + + + }