Concatenate strings in /addvar

This commit is contained in:
Cohee
2023-11-25 17:45:40 +02:00
parent 389c2b5435
commit 06ade803fa
2 changed files with 8 additions and 3 deletions

View File

@ -38,7 +38,9 @@ function addLocalVariable(name, value) {
const increment = Number(value);
if (isNaN(increment)) {
return '';
const stringValue = String(currentValue || '') + value;
setLocalVariable(name, stringValue);
return stringValue;
}
const newValue = Number(currentValue) + increment;
@ -56,7 +58,9 @@ function addGlobalVariable(name, value) {
const increment = Number(value);
if (isNaN(increment)) {
return '';
const stringValue = String(currentValue || '') + value;
setGlobalVariable(name, stringValue);
return stringValue;
}
const newValue = Number(currentValue) + increment;