I suggest you ...

[BUG] splitting expense by shares calculation isn't accurate

A lot of the times I am trying to split a bill between friends for food. I want to know how much I owe based on the price of my item, and how much we paid after taxes and tip. Owed = (total w/ taxes & tip) * (pre tax price / pretax total)

I try to do this with shares instead, so for an item for $15.50 I will enter as 1550 shares. The problem is, this calculation is rounded too much and the amount I owe is not deterministic.

For example, my friends ordered items that are $15.50, $14.95, $24.95, and after tax and tip we paid $68.42. I enter this as 1550, 1495 and 2495 shares. It shows up as $0.01 per share (which is fine in UI but you ought to be keeping a bigger number in code)

Problem is, when you enter all these numbers in, and for example, delete '5' and reenter '5' in the same field, the amount owed is recalculated and is different than before. The numbers are rarely accurate. Every time I do this exercise, the numbers change.

tl;dr on Android. when shares are > 1000, the calculation is inaccurate, you're probably rounding too much or not using the right data type.

4 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anne shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    Thanks for the feedback! We designed this feature around the idea that a couple might take two shares on an expense or a family might take 4 shares to avoid needing to have everyone on the expense, so the system currently calculates all the shares to the exact penny, with some getting an extra penny when rounding is necessary. As you noted, with large numbers of shares, the extra pennies get randomly assigned with a much larger variation than would be ideal.

    In theory, over time the way the extra pennies get assigned will be fair, but the next version of the Android app will use a different methodology that will handle these cases with much less variation. Most cases will not vary at all, but in some rare situations you might see the exact rounding vary by 1 penny.

    1 comment

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base