tkivy: fix history tab fiat values - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 2adabfd918abb16790092b2394f8917896ced4a5 DIR parent 8ad0c248a5fd83fda84760063173310fa4f07aaa HTML Author: SomberNight <somber.night@protonmail.com> Date: Sun, 21 Apr 2019 01:55:46 +0200 kivy: fix history tab fiat values follow-up 46f1fca7c3c1b2c35a589a48ae45cb1114ad28b5 Diffstat: M electrum/gui/kivy/uix/screens.py | 2 +- M electrum/util.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) --- DIR diff --git a/electrum/gui/kivy/uix/screens.py b/electrum/gui/kivy/uix/screens.py t@@ -152,7 +152,7 @@ class HistoryScreen(CScreen): fx = self.app.fx fiat_value = value / Decimal(bitcoin.COIN) * self.app.wallet.price_at_timestamp(tx_hash, fx.timestamp_rate) fiat_value = Fiat(fiat_value, fx.ccy) - ri['quote_text'] = str(fiat_value) + ri['quote_text'] = fiat_value.to_ui_string() return ri def update(self, see_all=False): DIR diff --git a/electrum/util.py b/electrum/util.py t@@ -178,6 +178,12 @@ class Fiat(object): else: return "{:.2f}".format(self.value) + def to_ui_string(self): + if self.value is None or self.value.is_nan(): + return _('No Data') + else: + return "{:.2f}".format(self.value) + ' ' + self.ccy + def __eq__(self, other): if self.ccy != other.ccy: return False