Browse Source

Refactor rounding logic

pull/7199/head
Thomas Kaul 2 weeks ago
parent
commit
b614b96b51
  1. 3
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.component.ts
  2. 8
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html

3
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: {

8
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"

Loading…
Cancel
Save