Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exact split incorrect calculation #113

Open
ammaraffan opened this issue Sep 29, 2024 · 5 comments
Open

Exact split incorrect calculation #113

ammaraffan opened this issue Sep 29, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ammaraffan
Copy link

Total bill 78.30.

Tried to split it 48.70 + 29.60, but the moment I wrote 48.70, it said the balance was 29.5999999994.

When I typed that the second person is 29.60, it said the remaining is -1.4210xxxx

image

image

image

@KMKoushik KMKoushik added the bug Something isn't working label Sep 29, 2024
@KMKoushik
Copy link
Member

ah that's bad, will work on it

@livingsilver94
Copy link

I don't know if Javascript allows that, but I'd just use fixed-point numbers with 3 decimal digits...

@ict
Copy link

ict commented Oct 12, 2024

Just a +1 from my side, looking into migrating to Split Pro vom Splitwise and running into the same issue. Floats cannot represent the exact fractions needed for monetary values.

@chiel1112
Copy link

chiel1112 commented Oct 22, 2024

My issue is similar but just about not the same, when adding a , to the amount it no longer counts towards the total balance
This is on a selfhosted docker instance installed two days ago.
image

@alexanderwassbjer
Copy link
Contributor

There is a PR open for this issue: #135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants