Here is the format string I mentioned. This is for the cleared
report. It colorizes lines whose cleared and uncleared balances
aren't equal, and uses the floor function on any account with "Owed"
in the name. For me that means "Tithe Owed".
--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))"
On Fri, Jan 6, 2012 at 16:50, Craig Earls <[email protected]> wrote:
> Actually, after further thought this is not as accurate as you might
> want. If you are looking to calculate 0.1 of your total increase
> rounded to the nearest dollar that is different than summing the
> rounding of all the individual increases. Ideally you would apply the
> rounding on the reporting end, which is easy to do:
>
> 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
>
> On Fri, Jan 6, 2012 at 14:27, Craig Earls <[email protected]> wrote:
>> The best way is to use a value expression in your automatic transaction:
>>
>> = /^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.
>>
>>
>>
>> On Fri, Jan 6, 2012 at 13:35, Zack Williams <[email protected]> wrote:
>>>> Is it possible to specify the rounding formula in a automatic transaction?
>>>> My specific case is that of tithe, I know I might be nitpicking, but
>>>> still,
>>>> I think it would be useful to have a way to say, always round up in the X
>>>> decimal place, or always round down. Here is an example:
>>>
>>> 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
>>
>>
>>
>> --
>> Craig, Corona De Tucson, AZ
>> enderw88.wordpress.com
>
>
>
> --
> Craig, Corona De Tucson, AZ
> enderw88.wordpress.com
--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com