<?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 BigDecimal divideAndRemainder in talend in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/BigDecimal-divideAndRemainder-in-talend/m-p/2210058#M8633</link>
    <description>&lt;P&gt;&lt;SPAN&gt;In a routine in talend open studio I wrote the following simple function which divides 2 BigDecimals and prints both the remainder of the division and the answer:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;public static void returnAnswer() {
    	BigDecimal bd0 = new BigDecimal("3445");
    	BigDecimal bd1 = new BigDecimal("9");
    	
    	BigDecimal[] bd2 = bd0.divideAndRemainder(bd1);
    	System.out.println(bd2[1].toString());
    	
    	StringBuilder sb = new StringBuilder();
    	sb.append(bd2[0].toString()).append(".").append(Integer.toString(bd2[1].intValueExact()));
    	
    	System.out.println("sb string --&amp;gt; " + sb.toString());
    	
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;However the result was:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;382.7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;77777778&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;382.77777778&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This happens to all the answers however I want the full answer not only 1 decimal digit, any help please would be appreciated, thanks,&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:39:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T02:39:44Z</dc:date>
    <item>
      <title>BigDecimal divideAndRemainder in talend</title>
      <link>https://community.qlik.com/t5/Talend-Studio/BigDecimal-divideAndRemainder-in-talend/m-p/2210058#M8633</link>
      <description>&lt;P&gt;&lt;SPAN&gt;In a routine in talend open studio I wrote the following simple function which divides 2 BigDecimals and prints both the remainder of the division and the answer:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;public static void returnAnswer() {
    	BigDecimal bd0 = new BigDecimal("3445");
    	BigDecimal bd1 = new BigDecimal("9");
    	
    	BigDecimal[] bd2 = bd0.divideAndRemainder(bd1);
    	System.out.println(bd2[1].toString());
    	
    	StringBuilder sb = new StringBuilder();
    	sb.append(bd2[0].toString()).append(".").append(Integer.toString(bd2[1].intValueExact()));
    	
    	System.out.println("sb string --&amp;gt; " + sb.toString());
    	
}&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;However the result was:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;382.7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Instead of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;77777778&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;382.77777778&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This happens to all the answers however I want the full answer not only 1 decimal digit, any help please would be appreciated, thanks,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:39:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/BigDecimal-divideAndRemainder-in-talend/m-p/2210058#M8633</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T02:39:44Z</dc:date>
    </item>
  </channel>
</rss>

