<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Float.valueOf for a String &amp; round decimal in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253914#M37087</link>
    <description>Hi I have also experienced this issue and found it only affected large numbers (100K +) and discovered that using the talend type of double has corrected it.</description>
    <pubDate>Fri, 26 Apr 2013 11:40:24 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2013-04-26T11:40:24Z</dc:date>
    <item>
      <title>Float.valueOf for a String &amp; round decimal</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253909#M37082</link>
      <description>hi all &lt;BR /&gt;we've some "strange" rounding behavior with reading a String and convert to a Float value.&lt;BR /&gt;from an Xml file, we insert &lt;B&gt;456193.15 as&lt;/B&gt; a String (mysql table).&lt;BR /&gt;When I read it &amp;amp; convert it to a Float (with  dedicated component or Float.valueOf method) it "rounded" to &lt;B&gt;456193.16&lt;/B&gt;. &lt;BR /&gt;Agree for some value like ......,98 or .....,99 !&lt;BR /&gt;is it a normal behavior, even if I know that Float doesn't keep "precision"&lt;BR /&gt;thanks for advice &lt;BR /&gt;regards&lt;BR /&gt;laurent</description>
      <pubDate>Mon, 22 Oct 2012 11:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253909#M37082</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-22T11:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Float.valueOf for a String &amp; round decimal</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253910#M37083</link>
      <description>hum .. 
&lt;BR /&gt;perhaps the reason is : 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;Rounding errors: Not every decimal number can be expressed exactly as a floating point number. This can be seen when entering "0.1" and examining its binary representation which is either slightly smaller or larger, depending on the last bit&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;??? 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;laurent</description>
      <pubDate>Mon, 22 Oct 2012 17:18:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253910#M37083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-22T17:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Float.valueOf for a String &amp; round decimal</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253911#M37084</link>
      <description>Hi Laurent ! 
&lt;BR /&gt;Note that trailing format specifiers, specifiers that determine the type of a floating-point literal (1.0f is a float value; 1.0d is a double value), do not influence the results of this method. In other words, the numerical value of the input string is converted directly to the target floating-point type. In general, the two-step sequence of conversions, string to double followed by double to float, is not equivalent to converting a string directly to float. For example, if first converted to an intermediate double and then to float, the string 
&lt;BR /&gt;"1.00000017881393421514957253748434595763683319091796875001d" 
&lt;BR /&gt;results in the float value 1.0000002f; if the string is converted directly to float, 1.0000001f results. 
&lt;BR /&gt; 
&lt;A href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Float.html#valueOf%28java.lang.String%29" rel="nofollow noopener noreferrer"&gt;http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Float.html#valueOf%28java.lang.String%29&lt;/A&gt; 
&lt;BR /&gt;Mohcine</description>
      <pubDate>Tue, 23 Oct 2012 09:01:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253911#M37084</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-23T09:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Float.valueOf for a String &amp; round decimal</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253912#M37085</link>
      <description>hi Cissine 
&lt;BR /&gt;thanks for complement of informations. 
&lt;BR /&gt; 
&lt;BR /&gt;Make some other test , and Float type round value as it want 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;As preconize Big Decimal is the only way to be keep value as it .... 
&lt;BR /&gt;I was suprising about rouding some values (456193.15) that dont' look like to be rounded (oups !!! 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MACn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154443iC5B8CACEF3D12C6A/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MACn.png" alt="0683p000009MACn.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;But seem to be the normal way . 
&lt;BR /&gt;@+ 
&lt;BR /&gt;laurent</description>
      <pubDate>Tue, 23 Oct 2012 11:18:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253912#M37085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-23T11:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Float.valueOf for a String &amp; round decimal</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253913#M37086</link>
      <description>Hello &lt;BR /&gt;During convertation Float.parseFloat("1.123456789") the result is 1.123 float, but it should be 1.123456789.&lt;BR /&gt;Please help with that problem.</description>
      <pubDate>Fri, 01 Feb 2013 07:33:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253913#M37086</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-02-01T07:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Float.valueOf for a String &amp; round decimal</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253914#M37087</link>
      <description>Hi I have also experienced this issue and found it only affected large numbers (100K +) and discovered that using the talend type of double has corrected it.</description>
      <pubDate>Fri, 26 Apr 2013 11:40:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Float-valueOf-for-a-String-round-decimal/m-p/2253914#M37087</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-04-26T11:40:24Z</dc:date>
    </item>
  </channel>
</rss>

