Repository navigation
Rounding each fee leg versus rounding the total with decimal128 #55751
ElonSabag
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I used a small
decimal128fixture to check a reporting question for simulated trading costs. If two modeled fee legs are each 0.013350, rounding each leg to cents gives 0.01 + 0.01. If I sum at the original precision and round only the displayed total, I get 0.03. Both calculations use the same rounding mode. The point at which rounding happens is what changes the result. These are illustrative amounts in dollars.I ran this with PyArrow 26.0.1. It gave me a compact regression check for distinguishing the precision used in a calculation from the precision used in its display.
I’m on the eStockes team. If you work on financial reports, I’d appreciate feedback on how we communicate that distinction. In this free IWM Reality Check example, expand “Method, costs and all trades” and then “Technical detail: recorded accounting and precision.” Can you tell which values are rounded for display and where to find the run totals? Past performance does not guarantee future results.
This discussion was drafted with generative AI, and the example was run before posting.
All reactions