From 525e08af5405c5406ed1953d676d69dc7915c6af Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 30 Oct 2015 13:26:37 +0100 Subject: [PATCH] kivy: fix amount edit --- gui/kivy/main_window.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/kivy/main_window.py b/gui/kivy/main_window.py index 35c184f4..b51fa086 100644 --- a/gui/kivy/main_window.py +++ b/gui/kivy/main_window.py @@ -443,9 +443,13 @@ class ElectrumWindow(App): def update_amount(self, amount, c): if c == '<': return amount[:-1] + if c == '.' and amount == '': + return '0.' + if c == '0' and amount == '0': + return '0' try: - s = amount + c - amount = s if Decimal(s)!=0 else '' + Decimal(amount+c) + amount += c except: pass return amount