Skip to content

Commit 660004e

Browse files
authored
Merge pull request #4659 from NoQQ/CATROID-1347
CATROID-1347 Fix testNumberOfItemsFunction testrunner test
2 parents 498a07f + 95d7a6c commit 660004e

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

catroid/src/main/java/org/catrobat/catroid/formulaeditor/FormulaElement.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,9 @@ private int calculateUserVariableLength(UserVariable userVariable) {
681681
if (userVariableValue instanceof String) {
682682
return String.valueOf(userVariableValue).length();
683683
} else {
684-
if (isInteger((Double) userVariableValue)) {
684+
if (userVariableValue.toString().equals("true") || userVariableValue.toString().equals("false")) {
685+
return 1;
686+
} else if (isInteger((Double) userVariableValue)) {
685687
return Integer.toString(((Double) userVariableValue).intValue()).length();
686688
} else {
687689
return Double.toString(((Double) userVariableValue)).length();

0 commit comments

Comments
 (0)