<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: NaN Error, Calculating default value</title><link>https://www.infopathdev.com:443/forums/thread/41018.aspx</link><pubDate>Mon, 27 Apr 2009 15:41:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:41018</guid><dc:creator>brandtsmith</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/41018.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=41018</wfw:commentRss><description>&lt;p&gt;I had to use both the rounding function AND the decimal(18,5) in SQL to prevent the NaN&lt;/p&gt;</description></item><item><title>Re: NaN Error, Calculating default value</title><link>https://www.infopathdev.com:443/forums/thread/30258.aspx</link><pubDate>Wed, 09 Jul 2008 20:42:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30258</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30258.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=30258</wfw:commentRss><description>&lt;p&gt;Thank you for posting your solution for others to see! I&amp;#39;m glad you were able to track down the problem. I found this post on the InfoPath team blog about floating point calculations that may explain the problem: &lt;a href="http://blogs.msdn.com/infopath/archive/2008/04/17/invalid-data-error-when-calculating-the-result-of-2-or-more-fields.aspx"&gt;http://blogs.msdn.com/infopath/archive/2008/04/17/invalid-data-error-when-calculating-the-result-of-2-or-more-fields.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: NaN Error, Calculating default value</title><link>https://www.infopathdev.com:443/forums/thread/30257.aspx</link><pubDate>Wed, 09 Jul 2008 20:26:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30257</guid><dc:creator>Patrick</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30257.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=30257</wfw:commentRss><description>&lt;p&gt;I finally got it!&amp;nbsp; It was the weirdest thing.&amp;nbsp; I have my data in an SQL server and the pieces of data that were being pulled into the Discount boxes were set to &amp;quot;float&amp;quot; in SQL.&amp;nbsp; I compared the values that were causing the error with the values that had no error and found that the &amp;quot;errored&amp;quot; data had one more digit in the decimal places than all of the rest in that column. &lt;/p&gt;&lt;p&gt;So I changed the type in SQL for that column to be &amp;quot;decimal(18, 5)&amp;quot; (decimal with precision 18 and scale 5.&amp;nbsp; &lt;/p&gt;&lt;p&gt;That fixed the problem.&lt;/p&gt;&lt;p&gt;My guess is that it was just too many digits for InfoPath to handle...maybe?&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I hope this helps anybody with a mysterious error like this in the future!&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: NaN Error, Calculating default value</title><link>https://www.infopathdev.com:443/forums/thread/30252.aspx</link><pubDate>Wed, 09 Jul 2008 19:00:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30252</guid><dc:creator>Patrick</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30252.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=30252</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Thanks for your response.&amp;nbsp; I am using IP 2007 and I looked in Form Options and found that the box is checked.&amp;nbsp; Also, ListPrice and Discount have values in them.&amp;nbsp; This is a strange one...&amp;nbsp; &lt;/p&gt;
&lt;p&gt;I&amp;#39;m going to delete the fields and recreate them for a fresh look.&amp;nbsp; I&amp;#39;ll post what happens.&amp;nbsp; In the meantime, if there are any other suggestions I&amp;#39;d gladly take a look.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;</description></item><item><title>Re: NaN Error, Calculating default value</title><link>https://www.infopathdev.com:443/forums/thread/30251.aspx</link><pubDate>Wed, 09 Jul 2008 18:51:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30251</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30251.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=30251</wfw:commentRss><description>&lt;p&gt;Hi --&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Just a thought, are you using InfoPath 2007? Under &lt;strong&gt;Form Options/Advanced&lt;/strong&gt; there is a checkbox to treat blank values as zero. If ListPrice or Discount are blank and this is not selected, you would get &lt;strong&gt;NaN&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>NaN Error, Calculating default value</title><link>https://www.infopathdev.com:443/forums/thread/30245.aspx</link><pubDate>Wed, 09 Jul 2008 17:06:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:30245</guid><dc:creator>Patrick</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/30245.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=30245</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Ok, this is a strange one.&amp;nbsp; I hope I&amp;#39;m just overlooking something.&lt;/p&gt;&lt;p&gt;&amp;nbsp;I have 3 fields in each row of a table (non-repeating).&amp;nbsp; There are many rows, and the fields are ListPrice, Discount, and FinalPrice.&amp;nbsp; Of my many rows, the FinalPrice fields has the same formula, but they reference their respective ListPrice and Discount fields to get the calculation result.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Here&amp;#39;s the formula: &lt;b&gt;ListPrice * (1 - Discount)&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Pretty simple huh?&amp;nbsp; Now, all of the ListPrice and FinalPrice fields are set to &amp;quot;Decimal&amp;quot; Data Type and are &amp;quot;Currency&amp;quot; with 2 decimal places and a comma separator.&lt;/p&gt;&lt;p&gt;All of the Decimal fields are set to &amp;quot;Decimal&amp;quot; Data Type and are &amp;quot;Percentage&amp;quot; with 2 decimal places and a comma separator.&lt;/p&gt;&lt;p&gt;Of the 5 rows in my table, 3 of them calculate perfectly.&amp;nbsp; The strange part is that 2 rows do not.&amp;nbsp; They give me an error &amp;quot;NaN&amp;quot; when I preview.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have tried different formulas to see if the field was somehow screwed up, and they worked.&amp;nbsp; I even tried setting their default values to equal ListPrice or Discount, and the numbers came through just fine.&amp;nbsp; I also tried multiplying ListPrice * Discount, and that did not come out correctly.&amp;nbsp; I think it has something to do with the number formatting, but I&amp;#39;m not sure.&lt;/p&gt;&lt;p&gt;I was wondering if anyone had any experience with this error, and why it occurs. &lt;/p&gt;&lt;p&gt;Thanks for any help!&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>