* nugget <[email protected]> [2020-08-07 14:49]:
> i get these very long decimal numbers when using the Decimal()
> method. See my minimal example. How can I fix this? rounding to two
> digits seems not to be the solution. Thanks!
This is what I use to round decimal numbers:
def d_round(d):
return d.quantize(D('.01'), rounding=decimal.ROUND_HALF_UP)
--
Martin Michlmayr
https://www.cyrius.com/
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beancount/20200808014622.GF11541%40jirafa.cyrius.com.