<?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: Tmap Float variable needs to Round in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316347#M86906</link>
    <description>&lt;P&gt;Solved! thanks&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Jul 2017 22:26:20 GMT</pubDate>
    <dc:creator>hgromek</dc:creator>
    <dc:date>2017-07-11T22:26:20Z</dc:date>
    <item>
      <title>Tmap Float variable needs to Round</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316345#M86904</link>
      <description>&lt;P&gt;This solution should be easy, however I can't seem to be able to figure it out.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;I need the result of a Float * int = float, to be rounded.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend.JPG" style="width: 460px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LuzR.jpg"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/140459i374105E64CE863F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LuzR.jpg" alt="0683p000009LuzR.jpg" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please let me know of any solutions you can think of.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 13:16:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316345#M86904</guid>
      <dc:creator>hgromek</dc:creator>
      <dc:date>2017-07-06T13:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap Float variable needs to Round</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316346#M86905</link>
      <description>&lt;P&gt;Math.round() will round a float or a double to the nearest integer. &amp;nbsp;To round to two decimal places, you would use:&lt;/P&gt;&lt;PRE&gt;Math.round(yourValueHere * 100.0)/100.0&lt;/PRE&gt;&lt;P&gt;To round to an arbitrary decimal precision, you have to get a little fancier. &amp;nbsp;This stackoverflow article talks about how to implement rounding to arbitrary precision:&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/8911356/whats-the-best-practice-to-round-a-float-to-2-decimals" target="_self" rel="nofollow noopener noreferrer"&gt;https://stackoverflow.com/questions/8911356/whats-the-best-practice-to-round-a-float-to-2-decimals&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could implement one of the solutions above in a routine in your repository, and just call that routine any time you need to round something. &amp;nbsp;If you don't foresee a frequent need to round values to arbitrary precision, I'd stick with an inline tMap formula.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 14:58:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316346#M86905</guid>
      <dc:creator>cterenzi</dc:creator>
      <dc:date>2017-07-06T14:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap Float variable needs to Round</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316347#M86906</link>
      <description>&lt;P&gt;Solved! thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 22:26:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316347#M86906</guid>
      <dc:creator>hgromek</dc:creator>
      <dc:date>2017-07-11T22:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap Float variable needs to Round</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316348#M86907</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The logic works partially for me. Could you please help here?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Math.round(yourValueHere * 100.0)/100.0&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I have the following values where I applied your logic:&lt;/P&gt;&lt;P&gt;215315.32499999998 results 215315.33 as expected&lt;/P&gt;&lt;P&gt;62644.37499999999 results 62644.37 I was expecting the result as&amp;nbsp;62644.38&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;BratB&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 20:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316348#M86907</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-17T20:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Tmap Float variable needs to Round</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316349#M86908</link>
      <description>&lt;P&gt;Apologies..my question was is there a way we can achieve below in talend&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;215315.32499999998 results 215315.33 as expected&lt;/P&gt;&lt;P&gt;62644.37499999999 results 62644.37 I was expecting the result as&amp;nbsp;62644.38&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Brat&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2019 20:33:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Tmap-Float-variable-needs-to-Round/m-p/2316349#M86908</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-17T20:33:32Z</dc:date>
    </item>
  </channel>
</rss>

