# Problems with decimals

**URL:** <https://discourse.nodered.org/t/problems-with-decimals/14990>\
**Category:** Dashboard\
**Created:** [1 September 2019 08:36 UTC](https://discourse.nodered.org/t/problems-with-decimals/14990 "2019-09-01T08:36:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![menno](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@menno](https://discourse.nodered.org/u/menno)\
**Post date:** [1 September 2019 08:36 UTC](https://discourse.nodered.org/t/problems-with-decimals/14990/1 "2019-09-01T08:36:16Z")

</div>

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](https://discourse.nodered.org/t/how-to-chart-graph-from-stored-text-files-to-the-chart/1803)

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}]

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [1 September 2019 08:45 UTC](https://discourse.nodered.org/t/problems-with-decimals/14990/2 "2019-09-01T08:45:28Z")

</div>

If parseInt returns an integer what will parseFloat return ?

---

<div class="post-metadata">

**Author:** ![menno](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@menno](https://discourse.nodered.org/u/menno)\
**Post date:** [1 September 2019 08:47 UTC](https://discourse.nodered.org/t/problems-with-decimals/14990/3 "2019-09-01T08:47:12Z")

</div>

> [@dceejay](#):
>
> parseFloat

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

---

<div class="post-metadata">

**Author:** ![menno](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@menno](https://discourse.nodered.org/u/menno)\
**Post date:** [1 September 2019 08:51 UTC](https://discourse.nodered.org/t/problems-with-decimals/14990/4 "2019-09-01T08:51:09Z")

</div>

YESS works great !!  
thanks man !  
 ![Untitled](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/841412c78c38810fe404830b0161b31012096704.png)
