AmountEdit:get_amount

This commit is contained in:
ThomasV 2014-07-16 15:33:59 +02:00
parent a195ca5c07
commit 068609b4a6
1 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,12 @@ class AmountEdit(MyLineEdit):
painter.setPen(self.help_palette.brush(QPalette.Disabled, QPalette.Text).color())
painter.drawText(textRect, Qt.AlignRight | Qt.AlignVCenter, self.base_unit())
def get_amount(self):
try:
x = int(str(self.text()))
except:
return None
return x
class BTCAmountEdit(AmountEdit):