Fix an error of "invalid literal for float()" if the balance is negative
Signed-off-by: Luc Didry <luc@didry.org> Signed-off-by: Romain Bignon <romain@symlink.me>
This commit is contained in:
parent
8f282c9ae8
commit
49ad32163d
1 changed files with 2 additions and 0 deletions
|
|
@ -147,6 +147,8 @@ class AccountsPage(BasePage):
|
||||||
account._type=value
|
account._type=value
|
||||||
account.label=a.getparent().getprevious().text.strip()
|
account.label=a.getparent().getprevious().text.strip()
|
||||||
balance=a.text.replace(u"\u00A0",'').replace(' ','').replace('.','').replace('+','').replace(',','.')
|
balance=a.text.replace(u"\u00A0",'').replace(' ','').replace('.','').replace('+','').replace(',','.')
|
||||||
|
if '-' in balance:
|
||||||
|
balance='-'+balance.strip().replace('-', '')
|
||||||
account.balance=float(balance)
|
account.balance=float(balance)
|
||||||
l.append(account)
|
l.append(account)
|
||||||
return l
|
return l
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue