bean-web: How to define the decimal precision?

518 views
Skip to first unread message

Roland Everaert

unread,
Nov 21, 2018, 12:13:06 PM11/21/18
to Beancount
Hello,

How can I tell bean-web the number of digits to display after the period?

I often see, in the balance sheet to name one page, thatvalues are rounded and no decimal is shown.

I want to see number with 1 or 2 digits after the decimal comma.

Example:

- Current configuration
Real value: 3.67
Displayed value: 4

- Expected configuration
Real value: 3.67
Displayed value: 3.67

I have seen some section about rounding and tolerance but my comprehention is that they have nothing to do with how numbers are displayed with bean-web.


Roland.

Martin Blais

unread,
Nov 22, 2018, 8:40:33 PM11/22/18
to bean...@googlegroups.com
Tolerances and precision for rendering are inferred, see this doc:
I don't remember if bean-web has ever been converted to use those though.
It's bound to be deleted anyway, not going to update it.

I'd like to add explicit options to force a desired precision at some point, this seems like a better default than atempting to infer everything automatically.




--
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/98d7106b-8167-4591-acd7-e9aaeca1ebf7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roland Everaert

unread,
Nov 23, 2018, 6:46:01 AM11/23/18
to bean...@googlegroups.com

Thanks for the link.

What will be deleted? bean-web?

I also think that adding some option in the beancount file, with regards
to precision, is way better, because it is 100% predictable.
>> <https://groups.google.com/d/msgid/beancount/98d7106b-8167-4591-acd7-e9aaeca1ebf7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>


--
Luke, use the FOSS

Sent from Emacs

Martin Blais

unread,
Nov 23, 2018, 9:50:19 AM11/23/18
to bean...@googlegroups.com
On Fri, Nov 23, 2018 at 6:46 AM Roland Everaert <r.eve...@gmail.com> wrote:

Thanks for the link.

What will be deleted? bean-web?

Yes, eventually, or if anything, it would be replaced by a bare-bones minimal thing fed by SQL queries only.
Please find long email on this list from previously.
Switch to Fava, it's much better.



I also think that adding some option in the beancount file, with regards
to precision, is way better, because it is 100% predictable.

I agree.


Roland Everaert

unread,
Nov 28, 2018, 10:29:26 AM11/28/18
to bean...@googlegroups.com
Is bean-query also affected by the same limitation?

I will try fava when times permit, thanks.

Roland Everaert

unread,
Dec 12, 2018, 6:34:05 AM12/12/18
to Beancount
Fava is effectively much better than bean-web. However, it still suffer from the fact that most columns are rounding-up values to the next integer instead of displaying the real number with its decimals :(

I hope this will be fixed soon, or maybe their is some parameters I can modify to set the precision to 1 or 2 digits after the decimal point.
>> >> 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/98d7106b-8167-4591-acd7-e9aaeca1ebf7%40googlegroups.com
>> >> <
>> https://groups.google.com/d/msgid/beancount/98d7106b-8167-4591-acd7-e9aaeca1ebf7%40googlegroups.com?utm_medium=email&utm_source=footer
>> >
>> >> .
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>
>>
>> --
>> Luke, use the FOSS
>>
>> Sent from Emacs
>>
>> --
>> 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

ethan.gla...@gmail.com

unread,
Mar 5, 2019, 11:51:01 AM3/5/19
to Beancount
I just encountered this myself and I wanted to write down what I figured out.

Beancount uses a "display context" to track statistics about precisions it sees in the input. Fava displays numbers using the "most common" precision. I guess this is the "mode" of the precisions Beancount has seen in a file: https://bitbucket.org/blais/beancount/src/945f4154f1af6b07674355c1798a27ff5d6c2794/beancount/core/display_context.py?at=default&fileviewer=file-view-default#display_context.py-163

It seems that Beancount may not track this number across files -- moving a bunch of transactions from a "main" file into a file imported using the "include" directive can change the precision.

As far as I know there is no parameter or option you can use to set this "display context" precision.

Ethan
>> >> 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/98d7106b-8167-4591-acd7-e9aaeca1ebf7%40googlegroups.com
>> >> <
>> https://groups.google.com/d/msgid/beancount/98d7106b-8167-4591-acd7-e9aaeca1ebf7%40googlegroups.com?utm_medium=email&utm_source=footer
>> >
>> >> .
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>
>>
>> --
>> Luke, use the FOSS
>>
>> Sent from Emacs
>>
>> --
>> 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

Martin Blais

unread,
Mar 6, 2019, 8:14:20 AM3/6/19
to Beancount
I'll look at adding an option to set it directly, this causes a lot of friction.

Roland Everaert

unread,
Mar 7, 2019, 3:58:34 AM3/7/19
to bean...@googlegroups.com
Thanks to both of you for your research and your commitment to improve
such a great tool in my life.

Have a nice day,

Roland Everaert.
>> <https://groups.google.com/d/msgid/beancount/1a8ce794-38bf-4c63-97c8-db4c8c33785b%40googlegroups.com?utm_medium=email&utm_source=footer>
Reply all
Reply to author
Forward
0 new messages