Skip to content

Commit 2047cfa

Browse files
authored
Merge pull request #381 from pythongosssss/evaluate-decimals
Add support for decimal evaluation
2 parents ecbde50 + efdc798 commit 2047cfa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/litegraph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10034,7 +10034,7 @@ LGraphNode.prototype.executeAction = function(action)
1003410034
if (event.click_time < 200 && delta == 0) {
1003510035
this.prompt("Value",w.value,function(v) {
1003610036
// check if v is a valid equation or a number
10037-
if (/^[0-9+\-*/()\s]+$/.test(v)) {
10037+
if (/^[0-9+\-*/()\s]+|\d+\.\d+$/.test(v)) {
1003810038
try {//solve the equation if possible
1003910039
v = eval(v);
1004010040
} catch (e) { }

0 commit comments

Comments
 (0)