From b614b96b51f16a2a529bc152276a828ce8f11521 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Fri, 3 Jul 2026 17:14:45 +0200 Subject: [PATCH] Refactor rounding logic --- .../holding-detail-dialog.component.ts | 3 ++- .../holding-detail-dialog/holding-detail-dialog.html | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts index 6fa3a4853..3ddcd4e19 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts @@ -77,7 +77,7 @@ import { swapVerticalOutline, walletOutline } from 'ionicons/icons'; -import { isNumber } from 'lodash'; +import { isNumber, round } from 'lodash'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; import { switchMap } from 'rxjs/operators'; @@ -170,6 +170,7 @@ export class GfHoldingDetailDialogComponent implements OnInit { protected quantity: number; protected quantityPrecision = 2; protected reportDataGlitchMail: string; + protected readonly round = round; protected readonly routerLinkAdminControlMarketData = internalRoutes.adminControl.subRoutes.marketData.routerLink; protected sectors: { diff --git a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html index ff1d19cc3..d0a1eae53 100644 --- a/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html +++ b/apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html @@ -118,8 +118,8 @@ i18n size="medium" [class.text-danger]=" - marketPriceMin?.toFixed(2) === marketPrice?.toFixed(2) && - marketPriceMax?.toFixed(2) !== marketPriceMin?.toFixed(2) + round(marketPriceMin, 2) === round(marketPrice, 2) && + round(marketPriceMax, 2) !== round(marketPriceMin, 2) " [isCurrency]="true" [locale]="data.locale" @@ -134,8 +134,8 @@ i18n size="medium" [class.text-success]=" - marketPriceMax?.toFixed(2) === marketPrice?.toFixed(2) && - marketPriceMax?.toFixed(2) !== marketPriceMin?.toFixed(2) + round(marketPriceMax, 2) === round(marketPrice, 2) && + round(marketPriceMax, 2) !== round(marketPriceMin, 2) " [isCurrency]="true" [locale]="data.locale"