bean-price precision

126 views
Skip to first unread message

Jorge Martínez López

unread,
Mar 5, 2022, 1:45:18 PM3/5/22
to bean...@googlegroups.com
Hello folks,

Since I upgraded to Beancount 2.3.5 I notice the output of bean-price
when using my ledger as input has way too many trailing zeros:

$ bean-price main.beancount --clobber
2022-03-04 price EUR 0.8259600000000000000000000000 GBP
2022-03-04 price USD 0.7548500000000000000000000000 GBP

But if I run bean-price using the price definition the rounding looks right:

$ bean-price -e GBP:yahoo/EURGBP=X
2022-03-04 price EURGBP=X 0.82596 GBP

$ bean-price -e GBP:yahoo/GBP=X
2022-03-04 price GBP=X 0.75485 GBP

How can I resolve this, please?

Thanks in advance!

Kind regards,
Jorge

Martin Carpella

unread,
Mar 14, 2022, 4:35:15 PM3/14/22
to Beancount
Hi,

I came across the same issue and filed an issue on GitHub for it: https://github.com/beancount/beancount/issues/712

The cause is this change, but I'm not deep enough in the code to know how to properly fix that: https://github.com/beancount/beancount/compare/2.3.4...2.3.5#diff-964d5a48eb7de50fd5adaf73ac07c1f2a688809b656bf8fa0781480dc4df2873R158

Best regards,
Martin
Reply all
Reply to author
Forward
0 new messages