Browse Source
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>
pull/329/head
Ivo Valchev
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
17 additions and
2 deletions
-
CHANGELOG.md
-
apps/client/src/app/components/position/position-detail-dialog/position-detail-dialog.html
-
apps/client/src/app/components/value/value.component.ts
|
|
@ -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 |
|
|
|
|
|
@ -102,9 +102,10 @@ |
|
|
|
</div> |
|
|
|
<div class="col-6 mb-3"> |
|
|
|
<gf-value |
|
|
|
label="Transactions" |
|
|
|
size="medium" |
|
|
|
[isCurrency]="true" |
|
|
|
[isCurrency]="false" |
|
|
|
[isInteger]="true" |
|
|
|
[label]="transactionCount === 1 ? 'Transaction' : 'Transactions'" |
|
|
|
[locale]="data.locale" |
|
|
|
[value]="transactionCount" |
|
|
|
></gf-value> |
|
|
|
|
|
@ -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 { |
|
|
|