Browse Source

Add colorSIgn & fix calculation

pull/5027/head
Dan 4 months ago
parent
commit
0be7fa960e
  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

@ -184,6 +184,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"
@ -219,6 +220,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

@ -98,11 +98,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