aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
authorNopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com>2022-11-01 23:11:47 +0000
committerGitHub <noreply@github.com>2022-11-02 00:11:47 +0100
commit7184121f7ae1f16a9bc8e51989f555d62b14bb24 (patch)
tree7ba186793b097394981bc1e34b42ab33aaffa25e /src/main/java/io
parent797b858e27c5e3c502e35f8fca74ee06f31e04a7 (diff)
downloadNotEnoughUpdates-7184121f7ae1f16a9bc8e51989f555d62b14bb24.tar.gz
NotEnoughUpdates-7184121f7ae1f16a9bc8e51989f555d62b14bb24.tar.bz2
NotEnoughUpdates-7184121f7ae1f16a9bc8e51989f555d62b14bb24.zip
added support for commas to /neucalc (#414)
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java4
1 files 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);
}