Closed PierreScerri closed 4 years ago
Hi Pierre, Sorry for the delay! Not sure at the moment how to handle this: add a input field on the config screen perhaps, where you can specify the number of decimal places? Or did you have anything else in mind? Thanks for reporting this issue!
My question was why is the sum of 7.9 & -3.3 = 4.60000000005? This messes up the display in Home Assistant and is also incorrect. Your idea of specifying the number of decimal places is interesting.
I have added a new checkbox to the config screen:
Would be nice if you could do some testing before I publish it on NPM. You can install it directly from this Github account like this (in your Node-RED folder):
npm install bartbutenaers/node-red-contrib-calc
Thank you for your efforts. I am running Node-red as an addon in Hassio. Added the package in the config and restarted the addon. The log says that:
[10:09:49] INFO: Starting installation of custom NPM/Node-RED packages...
+ node-red-contrib-calc@1.0.2
added 1 package from 1 contributor and audited 959 packages in 52.578s
29 packages are looking for funding
run `npm fund` for details
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
I think that it installed fine.
In Node-red, it still shows as 1.0.1. Don't know how to access the new version.
I assume you haven't installed it inside your Node-RED directory. Now you have somewhere the new version, but Node-RED still uses the old one... You should execute the install command inside the node-RED folder (e.g. cd $HOME/.node-red
). Hopefully it works then, otherwise I just need to publish it to npm tonight ...
Well the add-on should install it in its place I would imagine.
This is included in the Node-red addon config:
npm_packages:
- bartbutenaers/node-red-contrib-calc
Had a look in the node-red folder in my config and the old version is there.
Don't know where else to look.
Hey Pierre, I have published this feature on NPM in version 1.0.2 Please reopen this issue if the rounding feature doesn't work as expected. Bart
Thank you for efforts.
Unfortunately, as I've said before, I cannot install from the terminal as Hassio does not recognise the npm command. Tried installing from the add-on and it still reports 1.0.1.
So I can't test the new version.
Seems flows.nodered.org doesn't sync automatically anymore with npm. I have requested a manual refresh, and now it is updated to 1.0.3
Got it. It works.
Thank you.
The 'Sum' function randomly throws a result with several decimal places. The node is being supplied with 2 values in an array from a 'Join' node. Each value has 1 decimal place.