<?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[No way to convert float to integer??]]></title><description><![CDATA[<p dir="auto">I can't figure this out, there seems to be no way to convert a float to an integer<br />
Documentation says that Math::Floor as well as Math::Round should return an integer, but they do not</p>
<p dir="auto">Test code that shows all 3 values are returned as type 'real'. So how do I convert a to an integer to be able to use certain math operations correctly (i.e. modulus operator)</p>
<pre><code>a = 12.34;
b = Math::Floor(a);
c = Math::Round(a,0);

println(a);
println(b);
println(c);

println(typeof(a));
println(typeof(b));
println(typeof(c));
</code></pre>
]]></description><link>https://forum.netxms.org/topic/8036/no-way-to-convert-float-to-integer</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 06:23:04 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/8036.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Oct 2024 02:39:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to No way to convert float to integer?? on Thu, 03 Oct 2024 11:25:53 GMT]]></title><description><![CDATA[<p dir="auto">You can do type conversion this way:</p>
<pre><code>b = Math::Floor(12.34);
b = int32(a); println(typeof(b), b);
b = int64(a); println(typeof(b), b);
b = uint32(a); println(typeof(b), b);
b = uint64(a); println(typeof(b), b);
b = real(a); println(typeof(b), b);
b = boolean(a); println(typeof(b), b);
</code></pre>
]]></description><link>https://forum.netxms.org/post/33865</link><guid isPermaLink="true">https://forum.netxms.org/post/33865</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Thu, 03 Oct 2024 11:25:53 GMT</pubDate></item></channel></rss>