<?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: limit float to 2 places in tmap in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287706#M61266</link>
    <description>&lt;P&gt;Set the precision to 12 and just print to the output window. We need to know if this is a floating point issue caused during the processing of the number by Talend or after it is sent to Snowflake.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2019 15:59:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-06-19T15:59:37Z</dc:date>
    <item>
      <title>limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287697#M61257</link>
      <description>&lt;P&gt;I am using tmap to read data from a file and load it into a table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the columns in the text file contains values like:&lt;/P&gt;&lt;P&gt;0.05&lt;/P&gt;&lt;P&gt;0.03&lt;/P&gt;&lt;P&gt;etc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when Talend flow uploads the data into the table the values change from 0.05 to&amp;nbsp;&lt;SPAN&gt;0.05000000075&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;or from 0.03 to&amp;nbsp;&lt;SPAN&gt;0.03999999911.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have tried two approached in the tmap to try to reduce the value to two decimal places so I get only values like 0.05 or 0.03:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(row6.MinIncrease == null || row6.MinIncrease.equals("")) ? 0f :&lt;BR /&gt;row6.MinIncrease.floatValue() &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(row6.MinIncrease == null || row6.MinIncrease.equals("")) ? 0f :&lt;BR /&gt;Math.round(row6.MinIncrease*100)/100f&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but no luck. still getting values like&amp;nbsp;&lt;SPAN&gt;0.05000000075 .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What can I do here so I get only two decimal places?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 21:24:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287697#M61257</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-14T21:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287698#M61258</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; Did you try to add the precision part of your float column to 2?&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 951px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5v6.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/151476i9DC853EF58A553E0/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5v6.png" alt="0683p000009M5v6.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 21:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287698#M61258</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-14T21:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287699#M61259</link>
      <description>&lt;P&gt;Hello Nikhil,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I set the precision to 2 for the float data type. But that is not working for me. I am still seeing the same values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anything else I can do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:21:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287699#M61259</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-18T16:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287700#M61260</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Did you change the precision right from the schema of the input file or in between only from tMap?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt;
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287700#M61260</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-18T16:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287701#M61261</link>
      <description>&lt;P&gt;Please have a look at the attached screenshots:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is the schema for text file:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="textfile.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M60F.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/144450i11E525CF89A226EC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M60F.png" alt="0683p000009M60F.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Here is the tmap:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tmap.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5jt.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/141057iAC3C0FB1ECE42C19/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5jt.png" alt="0683p000009M5jt.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;One thing that I am doing in the tmap for this column is:&lt;/P&gt; 
&lt;P&gt;(row6.val == null || row6.val.equals("")) ? 0f :&lt;BR /&gt;Math.round(row6.val*100)/100f&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:32:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287701#M61261</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-18T16:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287702#M61262</link>
      <description>&lt;P&gt;I tried it on another float column and still no luck. &lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MPcz.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157233iD1A564EF62DE3BC2/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MPcz.png" alt="0683p000009MPcz.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:41:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287702#M61262</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-18T16:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287703#M61263</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp; &amp;nbsp; I am getting the data correctly for sample file.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 767px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M60U.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/133090i0340E87E23A8741F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M60U.png" alt="0683p000009M60U.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I tired to pass directly and also tried the function provided by you. But I did not get any issue.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M60e.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153396i5F291F1F25A7D2EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M60e.png" alt="0683p000009M60e.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Personally, I would only go by null check for a float column like below and do not go for equal comparison with empty string.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;Relational.ISNULL(row1.data)?0:row1.data &lt;/PRE&gt; 
&lt;P&gt;But if you are still having issue,&amp;nbsp;I might be missing something trivial here. Lets check with our Guru&amp;nbsp;&lt;A href="https://community.qlik.com/s/profile/005390000069RuGAAU"&gt;@rhall&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:50:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287703#M61263</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-18T16:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287704#M61264</link>
      <description>&lt;P&gt;Can you remove your database component and simply print out your number value to the output window? Also, what database are you using? This looks like a floating point error. If it occurs during your Talend job (which you should see by outputting the value to the output window), the best way of dealing with this would be to use a BigDecimal instead of a float.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 18:24:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287704#M61264</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-18T18:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287705#M61265</link>
      <description>&lt;P&gt;I am writing to Snowflake database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interestingly the source data file contains right value. For example:&lt;/P&gt;&lt;P&gt;0.05&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when written to Snowflake I get this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;0.05000000075&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I will go ahead and try to use BigDecimal (I have not seen this working with Snowflake though).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 15:45:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287705#M61265</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-19T15:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287706#M61266</link>
      <description>&lt;P&gt;Set the precision to 12 and just print to the output window. We need to know if this is a floating point issue caused during the processing of the number by Talend or after it is sent to Snowflake.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 15:59:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287706#M61266</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-06-19T15:59:37Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287707#M61267</link>
      <description>&lt;P&gt;I have turned on log4j and it prints each row of the data with correct values. Have a look at the last field below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2D072|753|2536.1667|0.0|&lt;/P&gt;&lt;P&gt;06052|401|1801.1893|0.05|&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 16:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287707#M61267</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-19T16:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287708#M61268</link>
      <description>&lt;P&gt;Also tried using BigDecimal. I could get the flow to execute with BigDecimal data type.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 16:51:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287708#M61268</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-19T16:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287709#M61269</link>
      <description>&lt;P&gt;I have got it to work. I modified the data type in the tmap to Double for both source and destination. Even though the column data type in Snowflake is float.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tmap.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M5o0.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140881i92D4793E16B4A4C6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M5o0.png" alt="0683p000009M5o0.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Appreciate your help and support. &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;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2019 17:01:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287709#M61269</guid>
      <dc:creator>talendstar</dc:creator>
      <dc:date>2019-06-19T17:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: limit float to 2 places in tmap</title>
      <link>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287710#M61270</link>
      <description>&lt;P&gt;it will not work, even if you change at schema level&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 10:52:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/limit-float-to-2-places-in-tmap/m-p/2287710#M61270</guid>
      <dc:creator>RahulKumar2</dc:creator>
      <dc:date>2021-05-28T10:52:14Z</dc:date>
    </item>
  </channel>
</rss>

