1
0

Fix nasty bug in amount editors

str() can convert amounts to scientific notation
This commit is contained in:
Neil Booth
2015-05-27 16:34:42 +09:00
parent 7becb28ec8
commit e5d243e08c
2 changed files with 9 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ from PyQt4.QtCore import *
from PyQt4.QtGui import *
from decimal import Decimal
from electrum.util import format_satoshis_plain
class MyLineEdit(QLineEdit):
frozen = pyqtSignal()
@@ -93,8 +94,5 @@ class BTCAmountEdit(AmountEdit):
def setAmount(self, amount):
if amount is None:
self.setText("")
return
p = pow(10, self.decimal_point())
x = amount / Decimal(p)
self.setText(str(x))
else:
self.setText(format_satoshis_plain(amount, self.decimal_point()))