AY1920S1-CS2103T-W11-2 / main

SplitWiser - Epic debt tracking
https://ay1920s1-cs2103t-w11-2.github.io/main/
MIT License
0 stars 5 forks source link

Expense amount / debt / display rounding #197

Closed liakify closed 4 years ago

liakify commented 4 years ago

How do we reconcile the internal value representations with what is displayed? Highly suspect people will try and poke around with this aspect during bug hunt if they can't figure any CRUD bugs (our CRUD aspect should generally be well covered by our tests).

  1. expense p/you p/sam p/tom e/0.01 d/free money Internally each person owes you 1/3 cents, but display rounding to 2dp will result in $0.00 entries being displayed. image

  2. expense p/you p/sam p/tom e/0.015 d/rounding pls Internally, sam and tom owe you 1/2 cents. However, 0.005 and 0.015 gets rounded to 0.01 and 0.02 respectively when displayed, so visually the debt values don't reconcile. image

  3. expense p/you p/sam p/tom e/0.01499999 d/roundabout image

  4. expense p/you p/tom e/0.01 d/more rounding image

liakify commented 4 years ago

Proposed fixes:

  1. Update UG to be very explicit about display value rounding
  2. If transfers amount rounded to 2dp = 0, do not display transfer
podocarp commented 4 years ago

I think it should be an input constraint instead. If anything is input with more than 2 decimals, raise warning/error since that's kind of not going to happen for normal expenses. As for uneven splitting, it is most unfortunate but will have to be accepted since there's no way to reconcile it even if you use a pocket calculator. I think the best we can do is to distribute the error across all people. Simply find the error, and assign a tiny fraction of it randomly to people involved until the error is minimized. That way at least statistically speaking it should be amortized.