|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
import { NUMERICAL_PRECISION_THRESHOLD_6_FIGURES } from '@ghostfolio/common/config'; |
|
|
import { |
|
|
import { |
|
|
canOpenHoldingDetail, |
|
|
canOpenHoldingDetail, |
|
|
getLocale, |
|
|
getLocale, |
|
|
@ -7,6 +8,7 @@ import { |
|
|
AssetProfileIdentifier, |
|
|
AssetProfileIdentifier, |
|
|
PortfolioPosition |
|
|
PortfolioPosition |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
} from '@ghostfolio/common/interfaces'; |
|
|
|
|
|
import { AssetSubClass } from '@prisma/client'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
CUSTOM_ELEMENTS_SCHEMA, |
|
|
CUSTOM_ELEMENTS_SCHEMA, |
|
|
@ -103,6 +105,28 @@ export class GfHoldingsTableComponent { |
|
|
return this.hasPermissionToOpenDetails() && canOpenHoldingDetail(holding); |
|
|
return this.hasPermissionToOpenDetails() && canOpenHoldingDetail(holding); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected getQuantityPrecision(holding: PortfolioPosition): number { |
|
|
|
|
|
if (Number.isInteger(holding.quantity)) { |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (holding.assetProfile.assetSubClass === AssetSubClass.CRYPTOCURRENCY) { |
|
|
|
|
|
if (holding.quantity < 10) { |
|
|
|
|
|
return 8; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (holding.quantity < 1000) { |
|
|
|
|
|
return 6; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (holding.quantity >= NUMERICAL_PRECISION_THRESHOLD_6_FIGURES) { |
|
|
|
|
|
return 0; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return 2; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
protected onOpenHoldingDialog({ |
|
|
protected onOpenHoldingDialog({ |
|
|
dataSource, |
|
|
dataSource, |
|
|
symbol |
|
|
symbol |
|
|
|