Skip to content

Commit

Permalink
Fix parsing negative credit amounts
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed Aug 20, 2024
1 parent 74b9c3b commit df28aff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/chat-plugins/auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Team {

function parseCredits(amount: string) {
let credits = Number(amount.replace(',', '.'));
if (credits < 500) credits *= 1000;
if (Math.abs(credits) < 500) credits *= 1000;
if (!credits || credits % 500 !== 0) {
throw new Chat.ErrorMessage(`The amount of credits must be a multiple of 500.`);
}
Expand Down

0 comments on commit df28aff

Please sign in to comment.