Problems with decimals

Hi guys i hope you can help me with this

i followed this link :

How to chart/graph from stored text files to the chart

to make a chart from my stored data. The only thing is that i have 3 decimals.
My data file contains these values:
1567202580002 - 0.076
1567288980003 - 0.393
My chart shows only 0 's . They are rounded. That's not what i want. I want to see the 3 decimals in my chart.
I allready know that this function will round up my values ( the second line):

var parts = msg.payload.split(/ - /).map(function(v) { return parseInt(v)});
msg.payload = {x:parts[0], y:parts[1]};
return msg;

can you please help me out here
!!!!!! Many many thanks in advance !!!!!!

here is my export

[{"id":"50553c97.eee004","type":"file in","z":"592831bd.0f054","name":"Read file /var/www/html/gasverbruikgister.txt","filename":"/var/www/html/gasverbruikgister.txt","format":"lines","chunk":false,"sendError":false,"x":390,"y":520,"wires":[["efa795b4.749488"]]},{"id":"efa795b4.749488","type":"function","z":"592831bd.0f054","name":"split all data","func":"var parts = msg.payload.split(/ - /).map(function(v) { return parseInt(v)});\nmsg.payload = {x:parts[0], y:parts[1]};\nreturn msg;\n","outputs":1,"noerr":0,"x":690,"y":520,"wires":[["f70e3892.028ea8"]]},{"id":"f70e3892.028ea8","type":"join","z":"592831bd.0f054","name":"join as array","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":870,"y":520,"wires":[["96dd251d.522b78"]]},{"id":"96dd251d.522b78","type":"function","z":"592831bd.0f054","name":"set labels","func":"msg.payload = [{\n "series": ["m3 verbruik"],\n "data": [msg.payload],\n "labels": ["testlabel"]\n}];\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":520,"wires":[["b6ff1b0d.8fec18","68e058fa.02aa28"]]},{"id":"b6ff1b0d.8fec18","type":"ui_chart","z":"592831bd.0f054","name":"","group":"881fe84b.484618","order":1,"width":10,"height":6,"label":"m3 verbruikt","chartType":"line","legend":"false","xformat":"DD-MM-YY HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1290,"y":520,"wires":[]},{"id":"6c230cf9.4e75c4","type":"inject","z":"592831bd.0f054","name":"at 0:06","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"06 00 * * *","once":false,"onceDelay":0.1,"x":120,"y":520,"wires":[["50553c97.eee004"]]},{"id":"68e058fa.02aa28","type":"debug","z":"592831bd.0f054","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1290,"y":600,"wires":},{"id":"881fe84b.484618","type":"ui_group","z":"","name":"gas m3 gebruikt","tab":"9f02ceb7.4e7c4","order":2,"disp":true,"width":"10","collapse":false},{"id":"9f02ceb7.4e7c4","type":"ui_tab","z":"","name":"Overzichten & totalen","icon":"dashboard","order":4,"disabled":false,"hidden":false}]

If parseInt returns an integer what will parseFloat return ?

to be honest .. i am new here ..
i will try .. thanks man !

YESS works great !!
thanks man !
Untitled

1 Like