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) { for (const index in parentHoldings) {
if (name === parentHoldings[index].name) { if (name === parentHoldings[index].name) {
return { return {
name: symbol, name: holding.name ?? symbol,
allocationInPercentage: allocationInPercentage:
(parentHoldings[index].valueInBaseCurrency / value) * parentHoldings[index].valueInBaseCurrency / value,
100,
valueInBaseCurrency: valueInBaseCurrency:
parentHoldings[index].valueInBaseCurrency parentHoldings[index].valueInBaseCurrency
}; };

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

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

Loading…
Cancel
Save