From 7184121f7ae1f16a9bc8e51989f555d62b14bb24 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 1 Nov 2022 23:11:47 +0000 Subject: added support for commas to /neucalc (#414) --- .../java/io/github/moulberry/notenoughupdates/util/Calculator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java index 221b5023..54636791 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java @@ -117,7 +117,7 @@ public class Calculator { token.tokenLength = 1; token.type = TokenType.LPAREN; token.operatorValue = "("; - } else if ('.' == c) { + } else if ('.' == c || ',' == c) { token.tokenLength = 1; token.type = TokenType.NUMBER; readDigitsInto(token, source, true); @@ -129,7 +129,7 @@ public class Calculator { readDigitsInto(token, source, false); if (i + token.tokenLength < source.length()) { char p = source.charAt(i + token.tokenLength); - if ('.' == p) { + if ('.' == p || ',' == p) { token.tokenLength++; readDigitsInto(token, source, true); } -- cgit