clarify random node info language

This commit is contained in:
Dave Conway-Jones
2018-09-24 19:40:33 +01:00
parent b0d98cca01
commit d32f11910b
3 changed files with 7 additions and 5 deletions

View File

@@ -11,10 +11,10 @@ module.exports = function(RED) {
this.on("input", function(msg) {
var value;
if (node.inte == "true" || node.inte === true) {
value = Math.round(Number(Math.random()) * (node.high - node.low + 1) + node.low - 0.5);
value = Math.round(Math.random() * (node.high - node.low + 1) + node.low - 0.5);
}
else {
value = Number(Math.random()) * (node.high - node.low) + node.low;
value = Math.random() * (node.high - node.low) + node.low;
}
RED.util.setMessageProperty(msg,node.property,value);
node.send(msg);