fix: 负值错误
This commit is contained in:
parent
0c67dbe66b
commit
de7bd7f8f2
2 changed files with 8 additions and 4 deletions
|
@ -1,2 +0,0 @@
|
||||||
from PyQt6.QtWidgets import *
|
|
||||||
from PyQt6.QtCore import *
|
|
|
@ -139,8 +139,14 @@ class TransTab(TabPage):
|
||||||
amountLabel = QLabel("Amount:")
|
amountLabel = QLabel("Amount:")
|
||||||
amountLine = QLineEdit()
|
amountLine = QLineEdit()
|
||||||
num = self.transData[self.rows[0].row()][5]
|
num = self.transData[self.rows[0].row()][5]
|
||||||
# 去掉¥符号
|
# 去掉¥符号,考虑负值
|
||||||
num = num[1:]
|
if num[0] == '-':
|
||||||
|
num = num[2:]
|
||||||
|
num = '-' + num
|
||||||
|
else:
|
||||||
|
num = num[1:]
|
||||||
|
|
||||||
|
|
||||||
amountLine.setText(num)
|
amountLine.setText(num)
|
||||||
# 只允许输入两位小数
|
# 只允许输入两位小数
|
||||||
amountLine.setValidator(QDoubleValidator(0.00, 999999999.99, 2))
|
amountLine.setValidator(QDoubleValidator(0.00, 999999999.99, 2))
|
||||||
|
|
Loading…
Reference in a new issue