1
0

move methods related to amount dialog

This commit is contained in:
ThomasV
2015-12-18 13:04:19 +01:00
parent f7a3b53c3f
commit e46b00bb39
4 changed files with 36 additions and 35 deletions

View File

@@ -491,28 +491,6 @@ class ElectrumWindow(App):
text += c
label.password = text
def toggle_fiat(self, a):
a.is_fiat = not a.is_fiat
def update_amount(self, label, c):
amount = label.fiat_amount if label.is_fiat else label.amount
if c == '<':
amount = amount[:-1]
elif c == '.' and amount == '':
amount = '0.'
elif c == '0' and amount == '0':
amount = '0'
else:
try:
Decimal(amount+c)
amount += c
except:
pass
if label.is_fiat:
label.fiat_amount = amount
else:
label.amount = amount
def format_amount(self, x, is_diff=False, whitespaces=False):
return format_satoshis(x, is_diff, 0, self.decimal_point(), whitespaces)