From 6cd6bdda7c922ef7aeda310e15be693442287e81 Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 16 May 2016 20:48:48 +0200 Subject: [PATCH] Fix error when "30x:AB" was not recognised as "3*0x:AB" --- .../org/solovyev/android/calculator/NumberBuilder.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/NumberBuilder.java b/app/src/main/java/org/solovyev/android/calculator/NumberBuilder.java index 401dceb0..d37547e0 100644 --- a/app/src/main/java/org/solovyev/android/calculator/NumberBuilder.java +++ b/app/src/main/java/org/solovyev/android/calculator/NumberBuilder.java @@ -117,7 +117,12 @@ public class NumberBuilder extends BaseNumberBuilder { return 0; } else { // process current number (and go to the next one) - return processNumber(sb); + final int offset = processNumber(sb); + if (result.type == MathType.numeral_base) { + // if current token is numeral base - update current numeral base + nb = NumeralBase.getByPrefix(result.match); + } + return offset; } }