<?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: Format value to two decimal places without rounding in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304664#M76409</link>
    <description>&lt;A href="https://community.qlik.com/s/profile/0053p000007LLseAAG"&gt;@vboppudi&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Tried your solution and encountering a blocking error. 
&lt;BR /&gt;Please see link below: 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCsPXCA0#M77203" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/Tmap-Error-NumberFormatException-For-input-string/m-p/122546#M77203&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Thank you for your help.</description>
    <pubDate>Mon, 04 Jun 2018 11:45:52 GMT</pubDate>
    <dc:creator>RA6</dc:creator>
    <dc:date>2018-06-04T11:45:52Z</dc:date>
    <item>
      <title>Format value to two decimal places without rounding</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304661#M76406</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to format the below value to two decimal places without rounding it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ColumnA&lt;/TD&gt;&lt;TD&gt;ColumnB&lt;/TD&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;171.456&lt;/TD&gt;&lt;TD&gt;2.321&lt;/TD&gt;&lt;TD&gt;169.135&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;25.45856&lt;/TD&gt;&lt;TD&gt;10.5426&lt;/TD&gt;&lt;TD&gt;14.91596&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For info, Column A, B, and result is of type String and this result&amp;nbsp;datatype in my output&amp;nbsp;to remain as String.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My expected output should be &lt;STRONG&gt;169.13&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;14.91&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried with the two option below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String.format("%.2f", (Double.parseDouble(ColumnA) - Double.parseDouble(ColumnB)))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String.format("%.2f", (new BigDecimal(Var.var2).subtract(new BigDecimal(Var.var3)))) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it is rounding the value to: 169.14 and 14.92&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, i want to know what is the difference between Big Decimal and Double? What should i use in my situation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Asadasing&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 08:19:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304661#M76406</guid>
      <dc:creator>RA6</dc:creator>
      <dc:date>2024-11-16T08:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Format value to two decimal places without rounding</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304662#M76407</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please try below.&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="Decimal1.PNG" style="width: 572px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LwzN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/156399iF35549F5982F7023/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LwzN.png" alt="0683p000009LwzN.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Decimal2.PNG" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LwzO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153533iF8D218D01F42A907/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LwzO.png" alt="0683p000009LwzO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 16:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304662#M76407</guid>
      <dc:creator>vboppudi</dc:creator>
      <dc:date>2018-05-02T16:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Format value to two decimal places without rounding</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304663#M76408</link>
      <description>Hello Veeranjaneyulu,
&lt;BR /&gt;Thank you for the solution. It works.
&lt;BR /&gt;However, do you know the difference between bigdecimal and double?
&lt;BR /&gt;
&lt;BR /&gt;How can you determine the usage of one of these?\
&lt;BR /&gt;
&lt;BR /&gt;Regards,
&lt;BR /&gt;Asadasing</description>
      <pubDate>Thu, 03 May 2018 08:45:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304663#M76408</guid>
      <dc:creator>RA6</dc:creator>
      <dc:date>2018-05-03T08:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Format value to two decimal places without rounding</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304664#M76409</link>
      <description>&lt;A href="https://community.qlik.com/s/profile/0053p000007LLseAAG"&gt;@vboppudi&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Tried your solution and encountering a blocking error. 
&lt;BR /&gt;Please see link below: 
&lt;BR /&gt; 
&lt;A href="https://community.qlik.com/s/feed/0D53p00007vCsPXCA0#M77203" target="_blank"&gt;https://community.talend.com/t5/Design-and-Development/Tmap-Error-NumberFormatException-For-input-string/m-p/122546#M77203&lt;/A&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;Thank you for your help.</description>
      <pubDate>Mon, 04 Jun 2018 11:45:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304664#M76409</guid>
      <dc:creator>RA6</dc:creator>
      <dc:date>2018-06-04T11:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Format value to two decimal places without rounding</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304665#M76410</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LMIZAA4"&gt;@asadasing&lt;/A&gt;,try with below way and let me know,if you are still facing issue.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;row3.newColumn2==null | row3.newColumn2.equals("")?"0"&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;row3.newColumn2.replace(",",".")).replace(" ","")&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jun 2018 13:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Format-value-to-two-decimal-places-without-rounding/m-p/2304665#M76410</guid>
      <dc:creator>manodwhb</dc:creator>
      <dc:date>2018-06-04T13:42:41Z</dc:date>
    </item>
  </channel>
</rss>

