You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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):
The text was updated successfully, but these errors were encountered:
MiahFuta
changed the title
Streamlabs Donation Handler
Streamlabs Donation Handler [Bug + Fix]
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):
The text was updated successfully, but these errors were encountered: