<?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[Get(true).proportion returns NaN]]></title><description><![CDATA[<p dir="auto">The metadata script:</p>
<pre><code>return WTenabled.past(HOUR, 1).get(true).proportion * 100; // % on last hour
</code></pre>
<p dir="auto">works in Mango 1.12.3, returning values between 0 and 100 inclusive depending on the past hour.</p>
<p dir="auto">However, it no longer works in MA 2.0: it returns: "Success. result=NaN"<br />
If I change get(true) to get(false):</p>
<pre><code>return WTenabled.past(HOUR, 1).get(false).proportion * 100; // % on last hour
</code></pre>
<p dir="auto">it returns: "Success. result=0.0"<br />
I wonder if the proportion code is missing a check for 0/0?</p>
]]></description><link>https://forum.mango-os.com/topic/1229/get-true-proportion-returns-nan</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Jul 2026 15:45:00 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/1229.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Jan 2013 10:33:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Get(true).proportion returns NaN on Fri, 11 Jan 2013 02:41:24 GMT]]></title><description><![CDATA[<p dir="auto">Great, thanks! Would that be 2.0.4? Where can I find the release notes or planned release date?</p>
]]></description><link>https://forum.mango-os.com/post/7379</link><guid isPermaLink="true">https://forum.mango-os.com/post/7379</guid><dc:creator><![CDATA[PCM]]></dc:creator><pubDate>Fri, 11 Jan 2013 02:41:24 GMT</pubDate></item><item><title><![CDATA[Reply to Get(true).proportion returns NaN on Thu, 10 Jan 2013 06:53:44 GMT]]></title><description><![CDATA[<p dir="auto">I found the problem. There will be a fix for this in the next release.</p>
]]></description><link>https://forum.mango-os.com/post/7369</link><guid isPermaLink="true">https://forum.mango-os.com/post/7369</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Thu, 10 Jan 2013 06:53:44 GMT</pubDate></item><item><title><![CDATA[Reply to Get(true).proportion returns NaN on Sat, 05 Jan 2013 03:08:04 GMT]]></title><description><![CDATA[<p dir="auto">There are no transitions during the past hour, but it did have a value that should have returned either 0% or 100%. as it did under M2M 1.12.3 even when there were no changes in the last hour. Also, get(false).proportion returns 0.0 but get(true).proportion returns NaN. If false returns 0.0, shouldn't true return 1.0?</p>
<p dir="auto">I see that now there is a .percentage function that can be used insead of .proportion * 100%. I tried it with the same result.</p>
<p dir="auto">Thank you for helping.</p>
]]></description><link>https://forum.mango-os.com/post/7348</link><guid isPermaLink="true">https://forum.mango-os.com/post/7348</guid><dc:creator><![CDATA[PCM]]></dc:creator><pubDate>Sat, 05 Jan 2013 03:08:04 GMT</pubDate></item><item><title><![CDATA[Reply to Get(true).proportion returns NaN on Fri, 04 Jan 2013 20:34:58 GMT]]></title><description><![CDATA[<p dir="auto">Are there actually any values over the past hour? You may need to add a check for "count &gt; 0". (Not the actual code required, just saying...)</p>
]]></description><link>https://forum.mango-os.com/post/7343</link><guid isPermaLink="true">https://forum.mango-os.com/post/7343</guid><dc:creator><![CDATA[mlohbihler]]></dc:creator><pubDate>Fri, 04 Jan 2013 20:34:58 GMT</pubDate></item></channel></rss>