Browse Source

Add parent value and fix percentage calculation

pull/4044/head
JoryHogeveen 9 months ago
parent
commit
cad15f7c2a
  1. 5
      apps/client/src/app/pages/portfolio/allocations/allocations-page.component.ts
  2. 15
      libs/ui/src/lib/top-holdings/top-holdings.component.html

5
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
};

15
libs/ui/src/lib/top-holdings/top-holdings.component.html

@ -76,9 +76,18 @@
>{{ parentHolding.name }}:</span
>
<span matListItemMeta>
{{
parentHolding.allocationInPercentage | number: '1.0-2'
}}%
<gf-value
[isCurrency]="true"
[locale]="locale"
[value]="parentHolding?.valueInBaseCurrency"
/>
</span>
<span matListItemMeta>
<gf-value
[isPercent]="true"
[locale]="locale"
[value]="parentHolding?.allocationInPercentage"
/>
</span>
</mat-list-item>
}

Loading…
Cancel
Save