My boat engine for some reason insists on sending fuel consumption in cubic meters per second over NMEA2000 to SignalK, which then gets MQTT'ed to Node-RED, which gives me a ridiculous number as 2.7777777777777776e-7 when I'm using 1,7 liters per hour (which is idle)!
I tried a quick function node:
var forbruk = msg.payload*6000000;
var avrundetforbruk = parseFloat(forbruk).toFixed(2);
msg.payload = avrundetforbruk;
return msg;
But that didn't work, I don't think the normal way of changing stuff to numbers work. I also tried a change node with this in:
$number(payload)
But that didn't seem to understand the idiotic number either. How do I convert this in the simplest way?