Merge pull request #52 from valitydev/ft/analytics

Fix update
This commit is contained in:
struga 2022-07-18 18:30:56 +03:00 committed by GitHub
commit 9edb13611c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1,11 +1,11 @@
<mat-card fxLayoutAlign="center">
<mat-card-content>
<h4 fxLayoutAlign="center">{{ headerText }}</h4>
<div *ngIf="inProgress | async" fxLayout fxLayoutAlign="center" style="height: 33px; width: 140px">
<div *ngIf="inProgress | async" fxLayout fxLayoutAlign="center" style="height: 33px; width: 135px">
<mat-progress-spinner color="primary" mode="indeterminate" diameter="33"></mat-progress-spinner>
</div>
<h1 *ngIf="!(inProgress | async)" [class]="type" fxLayoutAlign="center">
{{ numberFormat(valueNumber | number: '.1-4') }} {{ units }}
{{ numberFormat(valueNumber) | number: '.1-4' }} {{ units }}
</h1>
</mat-card-content>
</mat-card>

View File

@ -13,13 +13,13 @@ export class FbInfoCardComponent implements OnInit {
@Input() type: string;
@Input() inProgress: Observable<boolean>;
valueNumber = 0;
valueNumber = 0.0;
ngOnInit(): void {
this.value.subscribe((value) => (this.valueNumber = value ? value : 0));
}
numberFormat(num) {
return num === 'NaN' ? 0 : num;
return num === 'NaN' ? 0.0 : num;
}
}