fix: account modify

This commit is contained in:
iridiumR 2023-06-03 14:42:18 +08:00
parent d7737883f7
commit 903aae2c63
No known key found for this signature in database
GPG key ID: 49735733EB1A32C8

View file

@ -90,7 +90,7 @@ class AccountTab(TabPage):
a_id = self.rows[index][0]
print(a_id)
self.pg.execute(
"SELECT meta->>'name', meta->>'balance', meta->'description' FROM account WHERE a_id=%s", (a_id,))
"SELECT meta->>'name', replace(substring(balance::text, 2), ',', ''), meta->'description' FROM account WHERE a_id=%s", (a_id,))
data = self.pg.fetchall()
print(data)
@ -101,7 +101,7 @@ class AccountTab(TabPage):
balanceLabel = QLabel("Account Balance:")
balanceLine = QLineEdit()
balanceLine.setText(f'{float(data[0][1]):.2f}')
balanceLine.setText(data[0][1])
# 只允许输入两位小数
balanceLine.setValidator(QDoubleValidator(0.00, 999999999.99, 2))