<?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>SQL Database Integration</title><link>https://www.infopathdev.com:443/forums/47.aspx</link><description>For questions concerning issues in the integration of SQL and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>floats from SQL not recognized as numbers (scientific notation parsing issue?)</title><link>https://www.infopathdev.com:443/forums/thread/86141.aspx</link><pubDate>Thu, 17 Jan 2013 08:30:16 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:86141</guid><dc:creator>paolo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/86141.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=47&amp;PostID=86141</wfw:commentRss><description>&lt;p&gt;Hallo,&lt;/p&gt;&lt;p&gt;I am reporting a weird issue I had.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I was reading a floating point number directly from an SQL table (in this case with value=0.08) into an infopath text box.&amp;nbsp;&lt;/p&gt;&lt;p&gt;In SQL the column had the proper type of an 8 byte float (i.e. a double). &lt;br /&gt;&lt;/p&gt;&lt;p&gt;When read into an infopath text box connected to a *text (string)* field it would show in scientific notation as 8.0000000000000002E-2&lt;/p&gt;&lt;p&gt;When read into an infopath text box connected to a *decimal (double)* field it would show as a proper number 0.080000000.&lt;/p&gt;&lt;p&gt;However, it turns out there is a problem with the decimal field, in that the number (although it shows correctly) cannot properly&lt;/p&gt;&lt;p&gt;be parsed as double (for instance all arithmetic operations with it would return NaN, and also the built-in function&lt;/p&gt;&lt;p&gt;number(fieldname) would return NaN).&lt;/p&gt;&lt;p&gt;I did found a workaround - to use VB conversion functions (such as CDbl() ) to convert the string&amp;nbsp;  8.0000000000000002E-2 into&lt;/p&gt;&lt;p&gt;an usable float instead of the built-in number() function.&lt;/p&gt;&lt;p&gt;My speculation on what could possibly be happening is that the float is converted into a string by infopath on reading&lt;/p&gt;&lt;p&gt;the data, and that the built-in function number() is unable to convert this back to a float/double due to the&lt;/p&gt;&lt;p&gt;scientific notation being used in the string - however that does not explain why the number is properly displayed&lt;/p&gt;&lt;p&gt;(maybe yet another parsing routine is used for the display). &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Not sure if feature or bug... &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Has anyone else encountered this problem? Are you aware of simpler workarounds that do not require custom code? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Paolo Grigis&lt;/p&gt;&lt;p&gt;ABB Switzerland &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>