소스 검색

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


불러오는 중...
취소
저장