You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a rather serious bug. So here is a temporary fix while waiting for a proper one (for others having the same problem):
import re
f = open('invest.lgr', 'r')
d = f.readlines()
f.close()
res = []
for l in d:
l2 = l
match = re.search('.* [+-]?(?:\d+|\d{1,3}(?:,\d{3})*)(?:\.\d*)? @@.*', l)
if not match is None:
i = j = l.index('@@') - 2
while j > 0:
if not l[j] in '0123456789,.':
break
j -= 1
old_val = l[j:(i+1)]
new_val = str(float(old_val.replace(',','')))
l2 = l.replace(old_val, new_val)
res.append(l2)
with open(f'invest.lgr', 'w') as outfile:
outfile.write(''.join(res))
Commodities have thousand separators in the ledger output. This gives incorrect balances. See below:
It should be
The text was updated successfully, but these errors were encountered: