<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[NXLS Script returns bad sum values]]></title><description><![CDATA[<p dir="auto">Hello guys,</p>
<p dir="auto">I have one question about scripting in NetXMS. I wrote script, which simply sum three values and return this result.</p>
<p dir="auto">val1 = GetDCIValueByDescription ...<br />
val2 = GetDCIValueByDescription ...<br />
val3 = GetDCIValueByDescription ...</p>
<p dir="auto">return val1 + val2 + val3;</p>
<p dir="auto">When I return val1 or val2 or val3 it returns right number, but when I sum these values, it returns negative incorrect value.<br />
For example val1 = 200.50 val2 = 700.56 and val3 = 1500. When I sum it, it returns -1400 ... That's very strange ...<br />
I thought it could be due to overflow of float value, but somehow it works correctly on different servers with higher values.</p>
<p dir="auto">Any idea how to solve this or debug this?? Thank you in advance</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000003321-val.GIF" alt="val.GIF" class="img-markdown  img-fluid" width="1020" height="103" /></p>
]]></description><link>https://forum.netxms.org/topic/4782/nxls-script-returns-bad-sum-values</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 15:41:06 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4782.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 01 Nov 2016 09:41:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NXLS Script returns bad sum values on Wed, 02 Nov 2016 06:48:26 GMT]]></title><description><![CDATA[<p dir="auto">Ok, I solved it by:</p>
<p dir="auto">return real(GetDCIValueByDescription.....</p>
<p dir="auto">and also by val1 = real(GetDCI ...</p>
]]></description><link>https://forum.netxms.org/post/21310</link><guid isPermaLink="true">https://forum.netxms.org/post/21310</guid><dc:creator><![CDATA[Mystery]]></dc:creator><pubDate>Wed, 02 Nov 2016 06:48:26 GMT</pubDate></item><item><title><![CDATA[Reply to NXLS Script returns bad sum values on Tue, 01 Nov 2016 10:20:29 GMT]]></title><description><![CDATA[<p dir="auto">Well,</p>
<p dir="auto">return val1 / 1000 + val2 /1000 + val3 /1000;</p>
<p dir="auto">returns correct numbers (/1000 lower ofc), so it has to be something with overflow ...</p>
]]></description><link>https://forum.netxms.org/post/21306</link><guid isPermaLink="true">https://forum.netxms.org/post/21306</guid><dc:creator><![CDATA[Mystery]]></dc:creator><pubDate>Tue, 01 Nov 2016 10:20:29 GMT</pubDate></item></channel></rss>