<?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: How to remove decimal points from string field and round off in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-remove-decimal-points-from-string-field-and-round-off/m-p/2307696#M79111</link>
    <description>&lt;P&gt;There is a quite a straight forward answer to this using the BigDecimal class. Try this in a tJava component....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String stringNum = "&lt;SPAN&gt;3040000000005.78&lt;/SPAN&gt;";
BigDecimal bd = new BigDecimal(stringNum);

System.out.println(bd.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString());&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Jan 2018 16:38:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-01-16T16:38:24Z</dc:date>
    <item>
      <title>How to remove decimal points from string field and round off</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-remove-decimal-points-from-string-field-and-round-off/m-p/2307695#M79110</link>
      <description>&lt;P&gt;Hello Folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am new to Talend. I need below help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have input .like this which is String type in .csv file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;3040000000005.78&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And I want to convert this to&amp;nbsp;3040000000006&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This has removing decimal and round off to nearest integer.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Deepak&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 08:51:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-remove-decimal-points-from-string-field-and-round-off/m-p/2307695#M79110</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T08:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove decimal points from string field and round off</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-remove-decimal-points-from-string-field-and-round-off/m-p/2307696#M79111</link>
      <description>&lt;P&gt;There is a quite a straight forward answer to this using the BigDecimal class. Try this in a tJava component....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;String stringNum = "&lt;SPAN&gt;3040000000005.78&lt;/SPAN&gt;";
BigDecimal bd = new BigDecimal(stringNum);

System.out.println(bd.setScale(0, BigDecimal.ROUND_HALF_UP).toPlainString());&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2018 16:38:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-remove-decimal-points-from-string-field-and-round-off/m-p/2307696#M79111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-01-16T16:38:24Z</dc:date>
    </item>
  </channel>
</rss>

