Commit e10d0e5f authored by dev0tion's avatar dev0tion

Seperate coin notation from coin abbreviation

parent 74d1abc2
......@@ -13,46 +13,46 @@ export class CoinNotationPipe implements PipeTransform {
private coinNotation: number;
private decimalLimit = 8;
transform(value: any): any {
transform(value: number): number {
let temp;
if (typeof value === 'number') {
switch (this.getCoinUnit()) {
case "BTC":
temp = value / 100000000;
return temp.toFixed(this.decimalLimit) + " BTC";
return temp.toFixed(this.decimalLimit);
case "mBTC":
temp = value / 100000;
return temp.toFixed(this.decimalLimit) + " mBTC";
return temp.toFixed(this.decimalLimit);
case "uBTC":
temp = value / 100;
return temp.toFixed(this.decimalLimit) + " uBTC";
return temp.toFixed(this.decimalLimit);
case "TBTC":
temp = value / 100000000;
return temp.toFixed(this.decimalLimit) + " TBTC";
return temp.toFixed(this.decimalLimit);
case "TmBTC":
temp = value / 100000;
return temp.toFixed(this.decimalLimit) + " TmBTC";
return temp.toFixed(this.decimalLimit);
case "TuBTC":
temp = value / 100;
return temp.toFixed(this.decimalLimit) + " TuBTC";
return temp.toFixed(this.decimalLimit);
case "STRAT":
temp = value / 100000000;
return temp.toFixed(this.decimalLimit) + " STRAT";
return temp.toFixed(this.decimalLimit);
case "mSTRAT":
temp = value / 100000;
return temp.toFixed(this.decimalLimit) + " mSTRAT";
return temp.toFixed(this.decimalLimit);
case "uSTRAT":
temp = value / 100;
return temp.toFixed(this.decimalLimit) + " uSTRAT";
return temp.toFixed(this.decimalLimit);
case "TSTRAT":
temp = value / 100000000;
return temp.toFixed(this.decimalLimit) + " TSTRAT";
return temp.toFixed(this.decimalLimit);
case "TmSTRAT":
temp = value / 100000;
return temp.toFixed(this.decimalLimit) + " TmSTRAT";
return temp.toFixed(this.decimalLimit);
case "TuSTRAT":
temp = value / 100;
return temp.toFixed(this.decimalLimit) + " TuSTRAT";
return temp.toFixed(this.decimalLimit);
}
}
}
......
......@@ -10,7 +10,7 @@
<p class="lead">
<!--<strong><span class="h2">29</span>.76500293</strong>-->
<strong>{{ confirmedBalance | coinNotation }}</strong>
<!--<small class="text-uppercase">btc</small>-->
<small class="text-uppercase"> {{ coinUnit }}</small>
</p>
</div>
<!-- /col-->
......@@ -26,6 +26,7 @@
<h5>Unconfirmed balance</h5>
<p class="lead">
<strong>{{ unconfirmedBalance | coinNotation }}</strong>
<small class="text-uppercase"> {{ coinUnit }}</small>
</p>
</div>
<!-- /col-->
......@@ -56,7 +57,7 @@
<span *ngIf="transaction.transactionType == 'received'" class="text-success">+</span>
<span *ngIf="transaction.transactionType == 'sent'" class="text-danger">-</span>
{{ transaction.transactionAmount | coinNotation }}
<!--<small class="text-uppercase">btc</small>-->
<small class="text-uppercase">{{ coinUnit }}</small>
<span *ngIf="transaction.transactionConfirmedInBlock" class="badge badge-success text-capitalize">Confirmed</span>
<span *ngIf="!transaction.transactionConfirmedInBlock" class="badge badge-warning text-capitalize">Pending</span>
</li>
......
......@@ -25,11 +25,13 @@ export class DashboardComponent implements OnInit {
public confirmedBalance: number;
public unconfirmedBalance: number;
public transactionArray: TransactionInfo[];
public coinUnit: string;
private walletBalanceSubscription: Subscription;
private walletHistorySubscription: Subscription;
ngOnInit() {
this.startSubscriptions();
this.coinUnit = this.globalService.getCoinUnit();
};
ngOnDestroy() {
......
......@@ -31,7 +31,7 @@
<span *ngIf="transaction.transactionType == 'received'" class="text-success">+</span>
<span *ngIf="transaction.transactionType == 'sent'" class="text-danger">-</span>
{{ transaction.transactionAmount | coinNotation }}
<!--<small class="text-uppercase">btc</small>-->
<small class="text-uppercase"> {{ coinUnit }} </small>
<span *ngIf="transaction.transactionConfirmedInBlock" class="badge badge-success text-capitalize">Confirmed</span>
<span *ngIf="!transaction.transactionConfirmedInBlock" class="badge badge-warning text-capitalize">Pending</span>
</li>
......
......@@ -22,11 +22,13 @@ export class HistoryComponent {
constructor(private apiService: ApiService, private globalService: GlobalService, private modalService: NgbModal) {}
public transactions: TransactionInfo[];
public coinUnit: string;
private errorMessage: string;
private walletHistorySubscription: Subscription;
ngOnInit() {
this.startSubscriptions();
this.coinUnit = this.globalService.getCoinUnit();
}
ngOnDestroy() {
......
......@@ -12,8 +12,8 @@
</ul>
<ul class="list-inline row">
<li class="list-inline-item col blockLabel">Amount</li>
<li *ngIf="transaction.transactionType == 'received'" class="list-inline-item col-9 blockText text-success">{{ transaction.transactionAmount | coinNotation }}</li>
<li *ngIf="transaction.transactionType == 'sent'" class="list-inline-item col-9 blockText text-danger">-{{ transaction.transactionAmount | coinNotation }}</li>
<li *ngIf="transaction.transactionType == 'received'" class="list-inline-item col-9 blockText text-success">{{ transaction.transactionAmount | coinNotation }} {{ coinUnit }}</li>
<li *ngIf="transaction.transactionType == 'sent'" class="list-inline-item col-9 blockText text-danger">-{{ transaction.transactionAmount | coinNotation }} {{ coinUnit }}</li>
</ul>
<ul class="list-inline row">
<li *ngIf="transaction.transactionType == 'received'" class="list-inline-item col blockLabel">From</li>
......
......@@ -18,12 +18,14 @@ export class TransactionDetailsComponent implements OnInit, OnDestroy {
constructor(private apiService: ApiService, private globalService: GlobalService, public activeModal: NgbActiveModal) {}
public copied: boolean = false;
public coinUnit: string;
private generalWalletInfoSubscription: Subscription;
private lastBlockSyncedHeight: number;
private confirmations: number;
ngOnInit() {
this.startSubscriptions();
this.coinUnit = this.globalService.getCoinUnit();
}
ngOnDestroy() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment