diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 351609c4d..bf9e20f70 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -67,8 +67,10 @@ import { ChooseFeeLevelPage } from '../pages/choose-fee-level/choose-fee-level';
/* Receive */
import { CustomAmountPage } from '../pages/receive/custom-amount/custom-amount';
-/* Providers */
+/* Pipes */
+import { ToFiatPipe } from '../pipes/toFiat';
+/* Providers */
import { AddressBookProvider } from '../providers/address-book/address-book';
import { AppProvider } from '../providers/app/app';
import { BwcProvider } from '../providers/bwc/bwc';
@@ -196,8 +198,18 @@ let providers: any = [
}
];
+let pipes = [
+ ToFiatPipe,
+];
+
export function declarationsComponents() {
- return pages.concat(directives);
+ let declarations = [];
+
+ declarations = declarations.concat(pages);
+ declarations = declarations.concat(directives);
+ declarations = declarations.concat(pipes);
+
+ return declarations;
}
export function entryComponents() {
diff --git a/src/pages/wallet-details/wallet-details.html b/src/pages/wallet-details/wallet-details.html
index 09da5cfd2..97333a7df 100644
--- a/src/pages/wallet-details/wallet-details.html
+++ b/src/pages/wallet-details/wallet-details.html
@@ -19,7 +19,7 @@
{{tx.action}}
-
{{tx.amount}}
+
{{amountStr | toFiat : tx.amount : unitCode}}
{{tx.time * 1000 | amTimeAgo}}
diff --git a/src/pages/wallet-details/wallet-details.ts b/src/pages/wallet-details/wallet-details.ts
index fda9c8f0b..c7b4be79f 100644
--- a/src/pages/wallet-details/wallet-details.ts
+++ b/src/pages/wallet-details/wallet-details.ts
@@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { NavParams } from 'ionic-angular';
import { WalletProvider } from '../../providers/wallet/wallet';
+import { ConfigProvider } from '../../providers/config/config';
@Component({
selector: 'page-wallet-details',
@@ -8,13 +9,16 @@ import { WalletProvider } from '../../providers/wallet/wallet';
})
export class WalletDetailsPage {
public wallet: any;
+ public unitCode: string;
public alternativeBalanceStr: string;
constructor(
private navParams: NavParams,
private walletProvider: WalletProvider,
+ private configProvider: ConfigProvider,
) {
this.wallet = this.navParams.data.wallet;
+ this.unitCode = this.configProvider.get()['wallet']['settings'].unitCode;
}
ionViewDidEnter() {
diff --git a/src/pipes/toFiat.ts b/src/pipes/toFiat.ts
new file mode 100644
index 000000000..7315ed1d9
--- /dev/null
+++ b/src/pipes/toFiat.ts
@@ -0,0 +1,12 @@
+import { Pipe, PipeTransform } from '@angular/core';
+import { TxFormatProvider } from '../providers/tx-format/tx-format';
+
+@Pipe({ name: 'toFiat' })
+export class ToFiatPipe implements PipeTransform {
+ constructor(
+ private txFormatProvider: TxFormatProvider
+ ) {}
+ transform(value: string, satoshis: number, coin: string): any {
+ return this.txFormatProvider.formatAmountStr(coin, satoshis);
+ }
+}
\ No newline at end of file