You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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)
The text was updated successfully, but these errors were encountered: