Bugfix/fix dynamic decimal places for cryptocurrencies in position detail dialog (#1464)

* Fix dynamic decimal places

* Update changelog
pull/1465/head
Thomas Kaul 2 years ago committed by GitHub
parent b0d708fb82
commit 0d338bb083
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fixed the activities sorting in the position detail dialog
- Fixed the dynamic number of decimal places for cryptocurrencies in the position detail dialog
- Fixed a division by zero error in the cash positions calculation
## 1.213.0 - 14.11.2022

@ -14,6 +14,7 @@ import {
LineChartItem
} from '@ghostfolio/common/interfaces';
import { OrderWithAccount } from '@ghostfolio/common/types';
import { translate } from '@ghostfolio/ui/i18n';
import { Tag } from '@prisma/client';
import { format, isSameMonth, isToday, parseISO } from 'date-fns';
import { Subject } from 'rxjs';
@ -29,6 +30,8 @@ import { PositionDetailDialogParams } from './interfaces/interfaces';
styleUrls: ['./position-detail-dialog.component.scss']
})
export class PositionDetailDialog implements OnDestroy, OnInit {
public assetClass: string;
public assetSubClass: string;
public averagePrice: number;
public benchmarkDataItems: LineChartItem[];
public countries: {
@ -126,6 +129,14 @@ export class PositionDetailDialog implements OnDestroy, OnInit {
this.transactionCount = transactionCount;
this.value = value;
if (SymbolProfile?.assetClass) {
this.assetClass = translate(SymbolProfile?.assetClass);
}
if (SymbolProfile?.assetSubClass) {
this.assetSubClass = translate(SymbolProfile?.assetSubClass);
}
if (SymbolProfile?.countries?.length > 0) {
for (const country of SymbolProfile.countries) {
this.countries[country.code] = {

@ -139,11 +139,7 @@
>
</div>
<div class="col-6 mb-3">
<gf-value
i18n
size="medium"
[hidden]="!SymbolProfile?.assetClass"
[value]="SymbolProfile?.assetClass"
<gf-value i18n size="medium" [hidden]="!assetClass" [value]="assetClass"
>Asset Class</gf-value
>
</div>
@ -151,8 +147,8 @@
<gf-value
i18n
size="medium"
[hidden]="!SymbolProfile?.assetSubClass"
[value]="SymbolProfile?.assetSubClass"
[hidden]="!assetSubClass"
[value]="assetSubClass"
>Asset Sub Class</gf-value
>
</div>

@ -304,20 +304,6 @@ export class DataService {
}
}
if (data.SymbolProfile) {
if (data.SymbolProfile.assetClass) {
data.SymbolProfile.assetClass = <AssetClass>(
translate(data.SymbolProfile.assetClass)
);
}
if (data.SymbolProfile.assetSubClass) {
data.SymbolProfile.assetSubClass = <AssetSubClass>(
translate(data.SymbolProfile.assetSubClass)
);
}
}
return data;
})
);

Loading…
Cancel
Save