瀏覽代碼

Handle decimal point

karianne
Sindre Stephansen 3 年之前
父節點
當前提交
c662646407
共有 1 個檔案被更改,包括 10 行新增1 行删除
  1. +10
    -1
      ynab.py

+ 10
- 1
ynab.py 查看文件

@@ -29,7 +29,16 @@ def convert(reader, writer):
money_out = 0
money_in = 0

money = float(row[3].replace(',', '.'))
if (isinstance(row[3], str)):
moneystr = row[3].replace(',', '.')

try:
money = float(moneystr) if moneystr else 0
except ValueError as e:
print(f'Error in row {row}')
raise e
else:
money = float(row[3])

if money >= 0:
money_in = money


Loading…
取消
儲存