Browse Source
Merge pull request #10 from dandevaud/main
Latests changes
pull/5027/head
dandevaud
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
14 additions and
2 deletions
-
apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.component.ts
-
apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html
|
|
@ -55,6 +55,7 @@ export class PositionDetailDialog implements OnDestroy, OnInit { |
|
|
|
public orders: OrderWithAccount[]; |
|
|
|
public quantity: number; |
|
|
|
public quantityPrecision = 2; |
|
|
|
public stakePrecision = 2; |
|
|
|
public reportDataGlitchMail: string; |
|
|
|
public sectors: { |
|
|
|
[name: string]: { name: string; value: number }; |
|
|
@ -229,6 +230,13 @@ export class PositionDetailDialog implements OnDestroy, OnInit { |
|
|
|
|
|
|
|
if (Number.isInteger(this.quantity)) { |
|
|
|
this.quantityPrecision = 0; |
|
|
|
if ( |
|
|
|
orders |
|
|
|
.filter((o) => o.type === 'STAKE') |
|
|
|
.every((o) => Number.isInteger(o.quantity)) |
|
|
|
) { |
|
|
|
this.stakeRewards = 0; |
|
|
|
} |
|
|
|
} else if (this.SymbolProfile?.assetSubClass === 'CRYPTOCURRENCY') { |
|
|
|
if (this.quantity < 1) { |
|
|
|
this.quantityPrecision = 7; |
|
|
@ -237,6 +245,7 @@ export class PositionDetailDialog implements OnDestroy, OnInit { |
|
|
|
} else if (this.quantity > 10000000) { |
|
|
|
this.quantityPrecision = 0; |
|
|
|
} |
|
|
|
this.stakePrecision = this.quantityPrecision; |
|
|
|
} |
|
|
|
|
|
|
|
this.changeDetectorRef.markForCheck(); |
|
|
|
|
|
@ -141,12 +141,15 @@ |
|
|
|
> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div *ngIf="stakeRewards > 0" class="col-6 mb-3"> |
|
|
|
<div |
|
|
|
*ngIf="stakeRewards > 0 && dividendInBaseCurrency == 0" |
|
|
|
class="col-6 mb-3" |
|
|
|
> |
|
|
|
<gf-value |
|
|
|
i18n |
|
|
|
size="medium" |
|
|
|
[locale]="data.locale" |
|
|
|
[precision]="quantityPrecision" |
|
|
|
[precision]="stakePrecision" |
|
|
|
[value]="stakeRewards" |
|
|
|
>Stake Rewards |
|
|
|
</gf-value> |
|
|
|