I get similar results with payroll automatic transactions and
partial-cents rounding up or down after a few pay periods.
While it isn't "tidy", over the course of multiple transactions it is
more accurate, as these fractions of a cent may eventually accumulate
to a whole cent, and a rounding formula would likely throw this off.
(Insert Superman 2/Office Space joke here)
- Zack
= /^Income/
(Liabilities:Tithe) (0.1 * round(amount))
Unfortunately, round doesn't seem to let you control the precision so
you won't notice much since it will round to two digits.
I have another request to allow user controlled precision, but maybe
John has a different method.
--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com
2012/1/6 André Coelho <andre...@gmail.com>:
--
16:46:55 ~/FinanceData (master) > ledger bal 'Tithe Owed'
$ -1.75 Liabilities:Tithe Owed
16:47:11 ~/FinanceData (master) > ledger bal 'Tithe Owed' --format
"%10(floor(amount)) %20(account)\n"
$ -2.00 Liabilities:Tithe Owed
Which shows that I am slightly ahead on my tithe...
Of course it is much harder if you was a consolidated report of lots
of accounts, with only the Tithe Owed account rounded in this
fashion...it is possible, just harder...let me know if you want to see
a format string that could do that...
Craig
--format "%(ansify_if(
justify(depth_spacer + partial_account(options.flat), 18,
0, false, color) +
justify( ( account =~ /Owed/ ?
floor(scrub(get_at(total_expr, 0))) :
scrub(get_at(total_expr,
0))), 16, 16 + prepend_width, true, color) +
justify( ( account =~ /Owed/ ?
floor(scrub(get_at(total_expr, 1))) :
scrub(get_at(total_expr,
1))), 18, 36 + prepend_width, true, color) + ' ' +
(latest_cleared ? format_date(latest_cleared) : \" \"),
( get_at(total_expr, 1) == get_at( total_expr, 0))
? green : yellow ) )
%/ ------------ ------------
%34(get_at(display_total, 0)) %17(get_at(display_total, 1))"
> Unfortunately, round doesn't seem to let you control the precision so you
> won't notice much since it will round to two digits.
>
> I have another request to allow user controlled precision, but maybe John
> has a different method.
You can use (0.1 * unround(amount)), to turn rounding off. But currently
there is not a way to set the rounding precision for a given value. However,
that would be really easy to do, so that's a great feature idea.
John
Yeah, floor has a bug, and their needs to be a ceiling too. That one is known
at least. :)
John