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

Fix subtraction for decimals #125

Closed
Xd-pro opened this issue Mar 13, 2024 · 0 comments
Closed

Fix subtraction for decimals #125

Xd-pro opened this issue Mar 13, 2024 · 0 comments

Comments

@Xd-pro
Copy link

Xd-pro commented Mar 13, 2024

Currently the query looks like this:

"UPDATE " . $this->table . " SET amount = amount - ?, decimals = decimals - ? WHERE (xuid = ? OR username = ?) AND amount >= ? AND decimals >= ?"

Which will not allow subtracting decimals from a whole number balance. For example, if I had $10.00 and I wanted to take away $0.50, this query would fail because the decimals (00) is less than the amount of decimals I want to take (50).

github-actions bot added a commit that referenced this issue Mar 14, 2024
cooldogedev added a commit that referenced this issue Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants