<?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: round to 2 dp with Float.ValueOf() in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/round-to-2-dp-with-Float-ValueOf/m-p/2289541#M62913</link>
    <description>Hi buzzy, 
&lt;BR /&gt;What is the input data type? Also, float is only 32bit, so depending on the size of your number, you might lose precision after you round. Double or BigDecimal may be a better choice.
&lt;BR /&gt;For a double, you could use this to round: (Math.round(myField*100.0))/100.0
&lt;BR /&gt;For a BigDecimal, you could use this to round: myField.setScale(2, BigDecimal.ROUND_HALF_UP)
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Ben</description>
    <pubDate>Tue, 22 May 2012 16:02:15 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-05-22T16:02:15Z</dc:date>
    <item>
      <title>round to 2 dp with Float.ValueOf()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/round-to-2-dp-with-Float-ValueOf/m-p/2289540#M62912</link>
      <description>hi,&lt;BR /&gt;pls let me know any one...&lt;BR /&gt;round to 2 dp with Float.ValueOf()?&lt;BR /&gt;&lt;BR /&gt;thx</description>
      <pubDate>Tue, 22 May 2012 13:04:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/round-to-2-dp-with-Float-ValueOf/m-p/2289540#M62912</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-22T13:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: round to 2 dp with Float.ValueOf()</title>
      <link>https://community.qlik.com/t5/Talend-Studio/round-to-2-dp-with-Float-ValueOf/m-p/2289541#M62913</link>
      <description>Hi buzzy, 
&lt;BR /&gt;What is the input data type? Also, float is only 32bit, so depending on the size of your number, you might lose precision after you round. Double or BigDecimal may be a better choice.
&lt;BR /&gt;For a double, you could use this to round: (Math.round(myField*100.0))/100.0
&lt;BR /&gt;For a BigDecimal, you could use this to round: myField.setScale(2, BigDecimal.ROUND_HALF_UP)
&lt;BR /&gt;Thanks,
&lt;BR /&gt;Ben</description>
      <pubDate>Tue, 22 May 2012 16:02:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/round-to-2-dp-with-Float-ValueOf/m-p/2289541#M62913</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-22T16:02:15Z</dc:date>
    </item>
  </channel>
</rss>

