From 01feead0175c08efd5d4cbd8aa7481deba6b516e Mon Sep 17 00:00:00 2001 From: Ivo Valchev Date: Thu, 2 Sep 2021 20:47:27 +0200 Subject: [PATCH] Show decimal `transactionCount` and singular for 1 transaction (#327) * Show decimal `transactionCount` and singular for 1 transaction * Update changelog Co-authored-by: Thomas <4159106+dtslvr@users.noreply.github.com> --- CHANGELOG.md | 6 ++++++ .../position-detail-dialog/position-detail-dialog.html | 5 +++-- apps/client/src/app/components/value/value.component.ts | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8dfcd8a..e466f511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### Unreleased + +### Fixed + +- Fixed the value formatting for integers (transactions count) + ## 1.44.0 - 30.08.2021 ### Changed diff --git a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html index 870ec1fb..26e6aa43 100644 --- a/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html +++ b/apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html @@ -102,9 +102,10 @@
diff --git a/apps/client/src/app/components/value/value.component.ts b/apps/client/src/app/components/value/value.component.ts index b4b619c5..1452bef5 100644 --- a/apps/client/src/app/components/value/value.component.ts +++ b/apps/client/src/app/components/value/value.component.ts @@ -19,6 +19,7 @@ export class ValueComponent implements OnChanges, OnInit { @Input() colorizeSign: boolean; @Input() currency: string; @Input() isCurrency: boolean; + @Input() isInteger: boolean; @Input() isPercent: boolean; @Input() label: string; @Input() locale: string; @@ -84,6 +85,13 @@ export class ValueComponent implements OnChanges, OnInit { minimumFractionDigits: 2 }); } catch {} + } else if (this.isInteger) { + try { + this.formattedValue = this.value?.toLocaleString(this.locale, { + maximumFractionDigits: 0, + minimumFractionDigits: 0 + }); + } catch {} } } else { try {