From d7750c73e605fafcbc0a19d7a21480f6df996d15 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Mon, 23 Apr 2018 12:17:29 -0400 Subject: [PATCH] Use keyword arguments for format_amount call clarity (#4290) --- gui/qt/history_list.py | 2 +- gui/qt/main_window.py | 4 ++-- gui/qt/transaction_dialog.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gui/qt/history_list.py b/gui/qt/history_list.py index 3d522918e..57e8c87fd 100644 --- a/gui/qt/history_list.py +++ b/gui/qt/history_list.py @@ -239,7 +239,7 @@ class HistoryList(MyTreeWidget, AcceptFileDragDrop): status, status_str = self.wallet.get_tx_status(tx_hash, height, conf, timestamp) has_invoice = self.wallet.invoices.paid.get(tx_hash) icon = self.icon_cache.get(":icons/" + TX_ICONS[status]) - v_str = self.parent.format_amount(value, True, whitespaces=True) + v_str = self.parent.format_amount(value, is_diff=True, whitespaces=True) balance_str = self.parent.format_amount(balance, whitespaces=True) entry = ['', tx_hash, status_str, label, v_str, balance_str] fiat_value = None diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py index d21c01506..1edec3959 100644 --- a/gui/qt/main_window.py +++ b/gui/qt/main_window.py @@ -725,9 +725,9 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): c, u, x = self.wallet.get_balance() text = _("Balance" ) + ": %s "%(self.format_amount_and_units(c)) if u: - text += " [%s unconfirmed]"%(self.format_amount(u, True).strip()) + text += " [%s unconfirmed]"%(self.format_amount(u, is_diff=True).strip()) if x: - text += " [%s unmatured]"%(self.format_amount(x, True).strip()) + text += " [%s unmatured]"%(self.format_amount(x, is_diff=True).strip()) # append fiat balance and price if self.fx.is_enabled(): diff --git a/gui/qt/transaction_dialog.py b/gui/qt/transaction_dialog.py index d53997baf..b4989a18b 100644 --- a/gui/qt/transaction_dialog.py +++ b/gui/qt/transaction_dialog.py @@ -273,7 +273,7 @@ class TxDialog(QDialog, MessageBoxMixin): return ext def format_amount(amt): - return self.main_window.format_amount(amt, whitespaces = True) + return self.main_window.format_amount(amt, whitespaces=True) i_text = QTextEdit() i_text.setFont(QFont(MONOSPACE_FONT))