STscript: parse number operands with Number
| @@ -469,8 +469,8 @@ export function parseBooleanOperands(args) { | |||
| 469 | return ''; | 469 | return ''; |
| 470 | } | 470 | } |
| 471 | 471 | ||
| 472 | // parseFloat will return NaN for spaces. | 472 | // Number parses spaces as 0, and parseFloat is weird |
| 473 | const operandNumber = parseFloat(operand); | 473 | const operandNumber = operand?.trim()?.length ? Number(operand) : NaN; |
| 474 | 474 | ||
| 475 | if (!isNaN(operandNumber)) { | 475 | if (!isNaN(operandNumber)) { |
| 476 | return operandNumber; | 476 | return operandNumber; |