From 56cdc4a92bbb3f7c321589321a22f2e3ee718b81 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Sat, 11 Feb 2023 09:48:39 +0100 Subject: [PATCH] qml: fix display of negative millisat amounts in FormattedAmount, qefx.py --- electrum/gui/qml/components/controls/FormattedAmount.qml | 2 +- electrum/gui/qml/qefx.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/components/controls/FormattedAmount.qml b/electrum/gui/qml/components/controls/FormattedAmount.qml index 52327d7ff..04e342d89 100644 --- a/electrum/gui/qml/components/controls/FormattedAmount.qml +++ b/electrum/gui/qml/components/controls/FormattedAmount.qml @@ -24,7 +24,7 @@ GridLayout { } Label { visible: valid - text: amount.msatsInt > 0 ? Config.formatMilliSats(amount) : Config.formatSats(amount) + text: amount.msatsInt != 0 ? Config.formatMilliSats(amount) : Config.formatSats(amount) font.family: FixedFont } Label { diff --git a/electrum/gui/qml/qefx.py b/electrum/gui/qml/qefx.py index 3c31e5a9d..9cd3741ff 100644 --- a/electrum/gui/qml/qefx.py +++ b/electrum/gui/qml/qefx.py @@ -101,7 +101,7 @@ class QEFX(QObject, QtEventListener): def fiatValue(self, satoshis, plain=True): rate = self.fx.exchange_rate() if isinstance(satoshis, QEAmount): - satoshis = satoshis.msatsInt / 1000 if satoshis.msatsInt > 0 else satoshis.satsInt + satoshis = satoshis.msatsInt / 1000 if satoshis.msatsInt != 0 else satoshis.satsInt else: try: sd = Decimal(satoshis)