Browse Source

qml: fix display of negative millisat amounts in FormattedAmount, qefx.py

master
Sander van Grieken 3 years ago
parent
commit
56cdc4a92b
  1. 2
      electrum/gui/qml/components/controls/FormattedAmount.qml
  2. 2
      electrum/gui/qml/qefx.py

2
electrum/gui/qml/components/controls/FormattedAmount.qml

@ -24,7 +24,7 @@ GridLayout {
} }
Label { Label {
visible: valid 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 font.family: FixedFont
} }
Label { Label {

2
electrum/gui/qml/qefx.py

@ -101,7 +101,7 @@ class QEFX(QObject, QtEventListener):
def fiatValue(self, satoshis, plain=True): def fiatValue(self, satoshis, plain=True):
rate = self.fx.exchange_rate() rate = self.fx.exchange_rate()
if isinstance(satoshis, QEAmount): 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: else:
try: try:
sd = Decimal(satoshis) sd = Decimal(satoshis)

Loading…
Cancel
Save