bean-query rounding too much due to fractional_common

140 views
Skip to first unread message

Andrzej Kotulski

unread,
Jun 2, 2019, 3:09:22 PM6/2/19
to bean...@googlegroups.com
I have a problem when running bean-query - it's rounding numbers too
much which leads to wrong results in csv file I generate from it.
Is there a way to force set `fractional_common` somewhere?
Ideas:
1. I use custom importer to produce transactions, maybe there is a way
to automatically add two fractional zeroes to the transaction?
2. Or maybe I can set it explicitly for that currency?
3. For now I did this: add two fractional zeroes to most transactions
manually, this will force fractional_common=2

Use case is that I'm tracking time in quarter increments (15 min = 0.25
hr) but most of my "transactions" are either full hours or half hours.
This leads to deriving `fractional_common=1` which leads to reporting 15
minutes as 0.2 hours.

I attach file I used to illustrate the problem

$ bean-query test.beancount 'SELECT date, number WHERE account ~
"Expenses:Bills" AND month(date) = 5'
   date    numb
---------- ----
2019-05-03 15.5
2019-05-10 15.5
2019-05-20  5.2
-- SHOULD BE:
-- 2019-05-20  5.25

$ bean-doctor display_context test.beancount
USD             : sign=1   integer_max=4 fractional_common=1  
fractional_max=2   "-0000.0" "-0000.00"
__default__     : sign=0   integer_max=1 fractional_common=_  
fractional_max=_   "0.*" "0.*"

test.beancount

Martin Blais

unread,
Jun 7, 2019, 9:44:33 PM6/7/19
to Beancount
Long story short, not right now.
I've been working on it though, a couple of new options to override this and set it explicitly, that is an obvious annoyance and you're not the first to come across it.
I just haven't been able to find the time to finish this properly.
It's "top of mind" though (if this buzzword makes sense).



--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/e768b3db-31a6-17a3-3851-cfb8efdf2f93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages