mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
fix random number returning strings !
This commit is contained in:
parent
fa2ea96e67
commit
00fbae3ef6
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name" : "node-red-node-random",
|
||||
"version" : "0.3.0",
|
||||
"version" : "0.3.1",
|
||||
"description" : "A Node-RED node that when triggered generates a random number between two values.",
|
||||
"dependencies" : {
|
||||
},
|
||||
|
@ -16,7 +16,7 @@ module.exports = function(RED) {
|
||||
tmp.low = 1 // set this as the default low value
|
||||
tmp.low_e = ""
|
||||
if (node.low) { // if the the node has a value use it
|
||||
tmp.low = node.low
|
||||
tmp.low = Number(node.low);
|
||||
} else if ('from' in msg) { // else see if a 'from' is in the msg
|
||||
if (Number(msg.from)) { // if it is, and is a number, use it
|
||||
tmp.low = Number(msg.from);
|
||||
@ -29,7 +29,7 @@ module.exports = function(RED) {
|
||||
tmp.high = 10 // set this as the default high value
|
||||
tmp.high_e = "";
|
||||
if (node.high) { // if the the node has a value use it
|
||||
tmp.high = node.high
|
||||
tmp.high = Number(node.high);
|
||||
} else if ('to' in msg) { // else see if a 'to' is in the msg
|
||||
if (Number(msg.to)) { // if it is, and is a number, use it
|
||||
tmp.high = Number(msg.to);
|
||||
|
Loading…
x
Reference in New Issue
Block a user