mirror of
https://github.com/node-red/node-red.git
synced 2025-12-27 07:31:07 +01:00
Fix rounding errors for range node when using float inputs and integer outputs
And add extra tests
This commit is contained in:
@@ -24,6 +24,10 @@ module.exports = function(RED) {
|
||||
this.maxin = Number(n.maxin);
|
||||
this.minout = Number(n.minout);
|
||||
this.maxout = Number(n.maxout);
|
||||
if (this.round) {
|
||||
this.maxout = Math.floor(this.maxout);
|
||||
this.minout = Math.ceil(this.minout);
|
||||
}
|
||||
this.property = n.property||"payload";
|
||||
var node = this;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user