@@ -555,6 +555,10 @@ endf
555
555
" Reconcile the given account.
556
556
" This function accepts a file path as a third optional argument.
557
557
" The default is to use the value of g:ledger_main.
558
+ "
559
+ " Parameters:
560
+ " account An account name (String)
561
+ " target_amount The target amount (Float)
558
562
function ! ledger#reconcile (account, target_amount, ... )
559
563
let l: file = (a: 0 > 0 ? a: 1 : g: ledger_main )
560
564
let l: cmd = s: ledger_cmd ([
@@ -578,7 +582,7 @@ function! ledger#reconcile(account, target_amount, ...)
578
582
augroup END
579
583
" Add refresh shortcut
580
584
execute " nnoremap <silent> <buffer> <c-l> :<c-u>call ledger#reconcile('"
581
- \ . a: account . " '," . a: target_amount . " ,'" . l: file . " ')<cr>"
585
+ \ . a: account . " '," . string ( a: target_amount) . " ,'" . l: file . " ')<cr>"
582
586
" We need to pass the file path explicitly because at this point we are in
583
587
" the quickfix window
584
588
call ledger#show_balance (a: account , l: file )
@@ -644,7 +648,7 @@ function! ledger#show_balance(...)
644
648
if exists (' g:ledger_target_amount' )
645
649
echon ' ' g: ledger_target_string
646
650
echohl LedgerTarget
647
- echon printf (' %.2f' , (str2float ( g: ledger_target_amount) - str2float (l: amounts [2 ])))
651
+ echon printf (' %.2f' , (g: ledger_target_amount - str2float (l: amounts [2 ])))
648
652
echohl NONE
649
653
endif
650
654
endf
0 commit comments