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