electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit d4b9b1f3f9b7a2afd5b6ee0dbaeb76c61e8c666a
parent cf88b7f8a7d98cbe0d5988b8f01c98ff71ac970a
Author: ThomasV <thomasv@electrum.org>
Date:   Thu, 29 Jun 2017 18:40:49 +0200

Merge pull request #2457 from chris-belcher/master

Made status bar exchange rate display in terms of base unit
Diffstat:
Mgui/qt/main_window.py | 3++-
Mlib/exchange_rate.py | 6+++---
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gui/qt/main_window.py b/gui/qt/main_window.py @@ -660,7 +660,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError): # append fiat balance and price if self.fx.is_enabled(): - text += self.fx.get_fiat_status_text(c + u + x) or '' + text += self.fx.get_fiat_status_text(c + u + x, + self.base_unit(), self.get_decimal_point()) or '' if not self.network.proxy: icon = QIcon(":icons/status_connected.png") else: diff --git a/lib/exchange_rate.py b/lib/exchange_rate.py @@ -406,10 +406,10 @@ class FxThread(ThreadJob): rate = self.exchange_rate() return '' if rate is None else "%s %s" % (self.value_str(btc_balance, rate), self.ccy) - def get_fiat_status_text(self, btc_balance): + def get_fiat_status_text(self, btc_balance, base_unit, decimal_point): rate = self.exchange_rate() - return _(" (No FX rate available)") if rate is None else " 1 BTC~%s %s" % (self.value_str(COIN, rate), self.ccy) - + return _(" (No FX rate available)") if rate is None else " 1 %s~%s %s" % (base_unit, + self.value_str(COIN / (10**(8 - decimal_point)), rate), self.ccy) def value_str(self, satoshis, rate): if satoshis is None: # Can happen with incomplete history