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

Streamlabs Donation Handler [Bug + Fix] #2520

Closed
MiahFuta opened this issue Jul 22, 2021 · 0 comments
Closed

Streamlabs Donation Handler [Bug + Fix] #2520

MiahFuta opened this issue Jul 22, 2021 · 0 comments

Comments

@MiahFuta
Copy link

MiahFuta commented Jul 22, 2021

Sorry, I'm far too lazy to do a pull request, but this bug has been here for ages and it's rather annoying.

PhantomBot Version: EVERY
O/S Version: ANY
Java Version: ALL

Detailed Description:
Wrong Parse Method Used

Steps to Reproduce:
Any donation that's not an even dollar amount
In the screen shot below, both donations were added with 16.92
Though as you can see, the first one, with the old code, rounds down.
But the second one, with the new code, shows the correct donation amount.

The Fix:
Change parseInt, to parseFloat on line 64 in scripts/discord/handlers/streamlabsHandler.js

Before:
s = $.replace(s, '(amount)', parseInt(donationAmount).toFixed(2).toString());
After:
s = $.replace(s, '(amount)', parseFloat(donationAmount).toFixed(2).toString());

Screenshots (if applicable):

image

@MiahFuta MiahFuta changed the title Streamlabs Donation Handler Streamlabs Donation Handler [Bug + Fix] Jul 22, 2021
MzLiv pushed a commit to MzLiv/PhantomBot that referenced this issue Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant