Browse Source

Add colorSIgn & fix calculation

pull/4370/head
Dan 2 months ago
parent
commit
5b5b662758
  1. 2
      libs/ui/src/lib/holdings-table/holdings-table.component.html
  2. 4
      libs/ui/src/lib/holdings-table/holdings-table.component.ts

2
libs/ui/src/lib/holdings-table/holdings-table.component.html

@ -145,6 +145,7 @@
<td *matFooterCellDef class="px-1" mat-footer-cell>
<div class="d-flex justify-content-end">
<gf-value
[colorizeSign]="true"
[isCurrency]="true"
[locale]="locale"
[value]="totalChange"
@ -180,6 +181,7 @@
<td *matFooterCellDef class="px-1" mat-footer-cell>
<div class="d-flex justify-content-end">
<gf-value
[colorizeSign]="true"
[isPercent]="true"
[locale]="locale"
[value]="totalChangePercentage"

4
libs/ui/src/lib/holdings-table/holdings-table.component.ts

@ -97,11 +97,11 @@ export class GfHoldingsTableComponent implements OnChanges, OnDestroy {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
this.totalValue = this.dataSource.data.reduce(
(sum, current) => sum + current.valueInBaseCurrency,
(sum, current) => (sum += current.valueInBaseCurrency),
0
);
this.totalChange = this.dataSource.data.reduce(
(sum, current) => sum + current.netPerformancePercentWithCurrencyEffect,
(sum, current) => (sum += current.netPerformanceWithCurrencyEffect),
0
);
this.totalChangePercentage = (this.totalChange / this.totalValue) * 100;

Loading…
Cancel
Save