|
@ -443,9 +443,13 @@ class ElectrumWindow(App): |
|
|
def update_amount(self, amount, c): |
|
|
def update_amount(self, amount, c): |
|
|
if c == '<': |
|
|
if c == '<': |
|
|
return amount[:-1] |
|
|
return amount[:-1] |
|
|
|
|
|
if c == '.' and amount == '': |
|
|
|
|
|
return '0.' |
|
|
|
|
|
if c == '0' and amount == '0': |
|
|
|
|
|
return '0' |
|
|
try: |
|
|
try: |
|
|
s = amount + c |
|
|
Decimal(amount+c) |
|
|
amount = s if Decimal(s)!=0 else '' |
|
|
amount += c |
|
|
except: |
|
|
except: |
|
|
pass |
|
|
pass |
|
|
return amount |
|
|
return amount |
|
|