Open somas95 opened 2 years ago
Hi, thank you for reporting. I was aware of some of these issues, but haven't fixed it yet because it was tricky in the code.
Honestly, I don't recommend using POINTS_DECIMAL_PLACES, and as you can see it is not documented. Using whole numbers avoids a number of complications. My recommendation is to set your point magnitudes high enough that you don't care about rounding error. There is a note about this here: https://otree.readthedocs.io/en/latest/currency.html#decimal-places
Sadly that's not always possible, but thanks! If you need any help improving that let me know
There are at least two places where
POINTS_DECIMAL_PLACES
doesn't yield good results.First, it doesn't respect
LANGUAGE_CODE
so I'll get a point where a decimal comma is expected in languages like SpanishSecond, round operators won't work properly. The rounding happens but non significative digits are still shown
For example, if the variable
a = cu(0.32)
, and in the template I specify{{ a|to1 }}
I'll get0.30
where0.3
is expected.I can write a PR if desired (although the repo hasn't been updated for a while)