Call Ledger in full precision
This commit is contained in:
parent
caca8152ff
commit
e4c8d2f398
@ -80,10 +80,10 @@ def pandl():
|
||||
@app.template_filter('a')
|
||||
def filter_amount(amt):
|
||||
if amt > 0:
|
||||
return flask.Markup('{:,} '.format(amt).replace(',', ' ')) # Narrow no-break space
|
||||
return flask.Markup('{:,.2f} '.format(amt).replace(',', ' ')) # Narrow no-break space
|
||||
else:
|
||||
return flask.Markup('({:,})'.format(-amt).replace(',', ' '))
|
||||
return flask.Markup('({:,.2f})'.format(-amt).replace(',', ' '))
|
||||
|
||||
@app.template_filter('b')
|
||||
def filter_amount_positive(amt):
|
||||
return flask.Markup('{:,}'.format(amt).replace(',', ' '))
|
||||
return flask.Markup('{:,.2f}'.format(amt).replace(',', ' '))
|
||||
|
@ -43,7 +43,7 @@ class Account:
|
||||
return result
|
||||
|
||||
def run_ledger(*args):
|
||||
proc = subprocess.Popen(['ledger', '--args-only', '--file', config['ledger_file'], '-X', config['report_currency']] + config['ledger_args'] + list(args), encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
proc = subprocess.Popen(['ledger', '--args-only', '--file', config['ledger_file'], '-X', config['report_currency'], '--unround'] + config['ledger_args'] + list(args), encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = proc.communicate()
|
||||
|
||||
if stderr:
|
||||
|
Reference in New Issue
Block a user