<?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: Decimals in data type double in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Decimals-in-data-type-double/m-p/2341789#M109712</link>
    <description>&lt;P&gt;Hi you can use Bigdecimal and the method setScale:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public&amp;nbsp;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html" alt="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html" target="_blank"&gt;BigDecimal&lt;/A&gt;&amp;nbsp;setScale(int&amp;nbsp;newScale)&lt;/P&gt;&lt;P&gt;Returns a&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whose scale is the specified value, and whose value is numerically equal to this&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'s. Throws an&lt;/P&gt;&lt;P&gt;ArithmeticException&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if this is not possible.&lt;/P&gt;&lt;P&gt;This call is typically used to increase the scale, in which case it is guaranteed that there exists a&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;of the specified scale and the correct value. The call can also be used to reduce the scale if the caller knows that the&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;has sufficiently many zeros at the end of its fractional part (i.e., factors of ten in its integer value) to allow for the rescaling without changing its value.&lt;/P&gt;&lt;P&gt;This method returns the same result as the two-argument versions of&lt;/P&gt;&lt;P&gt;setScale&lt;/P&gt;&lt;P&gt;, but saves the caller the trouble of specifying a rounding mode in cases where it is irrelevant.&lt;/P&gt;&lt;P&gt;Note that since&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;objects are immutable, calls of this method do &lt;I&gt;not&lt;/I&gt; result in the original object being modified, contrary to the usual convention of having methods named set&lt;I&gt;X&lt;/I&gt; mutate field &lt;I&gt;X&lt;/I&gt;&lt;/P&gt;&lt;P&gt;. Instead,&lt;/P&gt;&lt;P&gt;setScale&lt;/P&gt;&lt;P&gt;returns an object with the proper scale; the returned object may or may not be newly allocated.&lt;/P&gt;&lt;P&gt;Parameters:&lt;/P&gt;&lt;P&gt;newScale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- scale of the&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;value to be returned.&lt;/P&gt;&lt;P&gt;Returns:&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;'s unscaled value by the appropriate power of ten to maintain its overall value.&lt;/P&gt;&lt;P&gt;Throws:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/lang/ArithmeticException.html" alt="https://docs.oracle.com/javase/7/docs/api/java/lang/ArithmeticException.html" target="_blank"&gt;ArithmeticException&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- if the specified scaling operation would require rounding.&lt;/P&gt;&lt;P&gt;See Also:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20int)" alt="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20int)" target="_blank"&gt;setScale(int, int)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;, &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20java.math.RoundingMode)" alt="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20java.math.RoundingMode)" target="_blank"&gt;setScale(int, RoundingMode)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get it from the oracle documentation.&lt;/P&gt;&lt;P&gt;Send me Love and Kudos&lt;/P&gt;</description>
    <pubDate>Thu, 06 May 2021 13:05:07 GMT</pubDate>
    <dc:creator>gjeremy1617088143</dc:creator>
    <dc:date>2021-05-06T13:05:07Z</dc:date>
    <item>
      <title>Decimals in data type double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Decimals-in-data-type-double/m-p/2341788#M109711</link>
      <description>&lt;P&gt;Hellow,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following problem loading data with Talend. In my source table (PostgreSQL) i have data (double) such as&lt;/P&gt;&lt;P&gt;532,56&lt;/P&gt;&lt;P&gt;136,44&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the process, the data (also double) is displayed to several decimal places in the target table like this:&lt;/P&gt;&lt;P&gt;532,55999756&lt;/P&gt;&lt;P&gt;136,44000244&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to load only the two decimal digits, as in the source table.&lt;/P&gt;&lt;P&gt;I tried to solve the problem by changing the precision and using functions like FIX, FFIX, REAL, convertImpliedDecimalFormat, round.... I have also tried with the different data types (float, double, bigdecimal) but the problem is not solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you advice please?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 12:24:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Decimals-in-data-type-double/m-p/2341788#M109711</guid>
      <dc:creator>APP</dc:creator>
      <dc:date>2021-05-06T12:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Decimals in data type double</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Decimals-in-data-type-double/m-p/2341789#M109712</link>
      <description>&lt;P&gt;Hi you can use Bigdecimal and the method setScale:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;public&amp;nbsp;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html" alt="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html" target="_blank"&gt;BigDecimal&lt;/A&gt;&amp;nbsp;setScale(int&amp;nbsp;newScale)&lt;/P&gt;&lt;P&gt;Returns a&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whose scale is the specified value, and whose value is numerically equal to this&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'s. Throws an&lt;/P&gt;&lt;P&gt;ArithmeticException&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if this is not possible.&lt;/P&gt;&lt;P&gt;This call is typically used to increase the scale, in which case it is guaranteed that there exists a&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;of the specified scale and the correct value. The call can also be used to reduce the scale if the caller knows that the&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;has sufficiently many zeros at the end of its fractional part (i.e., factors of ten in its integer value) to allow for the rescaling without changing its value.&lt;/P&gt;&lt;P&gt;This method returns the same result as the two-argument versions of&lt;/P&gt;&lt;P&gt;setScale&lt;/P&gt;&lt;P&gt;, but saves the caller the trouble of specifying a rounding mode in cases where it is irrelevant.&lt;/P&gt;&lt;P&gt;Note that since&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;objects are immutable, calls of this method do &lt;I&gt;not&lt;/I&gt; result in the original object being modified, contrary to the usual convention of having methods named set&lt;I&gt;X&lt;/I&gt; mutate field &lt;I&gt;X&lt;/I&gt;&lt;/P&gt;&lt;P&gt;. Instead,&lt;/P&gt;&lt;P&gt;setScale&lt;/P&gt;&lt;P&gt;returns an object with the proper scale; the returned object may or may not be newly allocated.&lt;/P&gt;&lt;P&gt;Parameters:&lt;/P&gt;&lt;P&gt;newScale&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- scale of the&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;value to be returned.&lt;/P&gt;&lt;P&gt;Returns:&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whose scale is the specified value, and whose unscaled value is determined by multiplying or dividing this&lt;/P&gt;&lt;P&gt;BigDecimal&lt;/P&gt;&lt;P&gt;'s unscaled value by the appropriate power of ten to maintain its overall value.&lt;/P&gt;&lt;P&gt;Throws:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/lang/ArithmeticException.html" alt="https://docs.oracle.com/javase/7/docs/api/java/lang/ArithmeticException.html" target="_blank"&gt;ArithmeticException&lt;/A&gt;&lt;/P&gt;&lt;P&gt;- if the specified scaling operation would require rounding.&lt;/P&gt;&lt;P&gt;See Also:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20int)" alt="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20int)" target="_blank"&gt;setScale(int, int)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;, &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20java.math.RoundingMode)" alt="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20java.math.RoundingMode)" target="_blank"&gt;setScale(int, RoundingMode)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get it from the oracle documentation.&lt;/P&gt;&lt;P&gt;Send me Love and Kudos&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 13:05:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Decimals-in-data-type-double/m-p/2341789#M109712</guid>
      <dc:creator>gjeremy1617088143</dc:creator>
      <dc:date>2021-05-06T13:05:07Z</dc:date>
    </item>
  </channel>
</rss>

