@@ -152,7 +152,7 @@ class HistoryScreen(CScreen):
|
|||||||
fx = self.app.fx
|
fx = self.app.fx
|
||||||
fiat_value = value / Decimal(bitcoin.COIN) * self.app.wallet.price_at_timestamp(tx_hash, fx.timestamp_rate)
|
fiat_value = value / Decimal(bitcoin.COIN) * self.app.wallet.price_at_timestamp(tx_hash, fx.timestamp_rate)
|
||||||
fiat_value = Fiat(fiat_value, fx.ccy)
|
fiat_value = Fiat(fiat_value, fx.ccy)
|
||||||
ri['quote_text'] = str(fiat_value)
|
ri['quote_text'] = fiat_value.to_ui_string()
|
||||||
return ri
|
return ri
|
||||||
|
|
||||||
def update(self, see_all=False):
|
def update(self, see_all=False):
|
||||||
|
|||||||
@@ -178,6 +178,12 @@ class Fiat(object):
|
|||||||
else:
|
else:
|
||||||
return "{:.2f}".format(self.value)
|
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):
|
def __eq__(self, other):
|
||||||
if self.ccy != other.ccy:
|
if self.ccy != other.ccy:
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user